Skip to content

Commit

Permalink
Use ID parameter type for leg query
Browse files Browse the repository at this point in the history
  • Loading branch information
vesameskanen committed Sep 24, 2024
1 parent b75c047 commit 1a43221
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public DataFetcher<Leg> leg() {
return environment -> {
TransitService transitService = getTransitService(environment);
var args = new GraphQLTypes.GraphQLQueryTypeLegArgs(environment.getArguments());
String id = args.getGraphQLId();
String id = args.getGraphQLId().getId();
LegReference ref = LegReferenceSerializer.decode(id);
if (ref == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2434,19 +2434,19 @@ public void setGraphQLTime(Integer time) {

public static class GraphQLQueryTypeLegArgs {

private String id;
private graphql.relay.Relay.ResolvedGlobalId id;

public GraphQLQueryTypeLegArgs(Map<String, Object> args) {
if (args != null) {
this.id = (String) args.get("id");
this.id = (graphql.relay.Relay.ResolvedGlobalId) args.get("id");
}
}

public String getGraphQLId() {
public graphql.relay.Relay.ResolvedGlobalId getGraphQLId() {
return this.id;
}

public void setGraphQLId(String id) {
public void setGraphQLId(graphql.relay.Relay.ResolvedGlobalId id) {
this.id = id;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ type QueryType {
time: Int!
): Trip
"Try refetching the current state of a transit leg using its ID"
leg(id: String!): Leg
leg(id: ID!): Leg
"""
Get all places (stops, stations, etc. with coordinates) within the specified
radius from a location. The returned type is a Relay connection (see
Expand Down

0 comments on commit 1a43221

Please sign in to comment.