You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using argument :after in a field causes DuplicateNamesError when fetching the whole schema in Graphiql:
GraphQL::Schema::DuplicateNamesError - Found two visible definitions for `Me.events_connection.after`:
#<GraphQL::Schema::Argument Me.events_connection.after: String @description="Returns the elements in the list that come after the specified cursor.">,
#<GraphQL::Schema::Argument Me.events_connection.after: String! @description="Fetch items after this cursor">
Versions
graphql: 1.13.23 rails: 6.1 graphql-batch: 0.6.0
GraphQL schema
Include relevant types and fields (in Ruby is best, in GraphQL IDL is ok). Any custom extensions, etc?
field:events_connection,Types::EventsConnectionTypedoargument:after,String,description: "Fetch items after this cursor"# other argumentsend
GraphQL query
Fetch the whole shema in Graphiql
The text was updated successfully, but these errors were encountered:
field.argument:after,"String","Returns the elements in the list that come after the specified cursor.",required: false
field.argument:before,"String","Returns the elements in the list that come before the specified cursor.",required: false
field.argument:first,"Int","Returns the first _n_ elements from the list.",required: false
field.argument:last,"Int","Returns the last _n_ elements from the list.",required: false
end
Another approach would be to delete the one you don't want:
# Define the field field:events_connection ... doend# Remove the argument that GraphQL-Ruby added automatically:events_conn_field=get_field("eventsConnection")duplicate_defn=events_conn_field.all_argument_definitions.find{ |arg| arg.keyword == :after && arg.desciption != "Fetch items after this cursor"}events_conn_field.remove_argument(duplicate_defn)
Another approach would be to pass field ... connection: false to opt out of GraphQL-Ruby's automatic connection handling. But if you did that, you'd have to also define :before, :first, and :last, and manually wrap the list in a connection wrapper object. So it's probably a bit heavy-handed.
Describe the bug
Using
argument :after
in a field causesDuplicateNamesError
when fetching the whole schema in Graphiql:Versions
graphql
: 1.13.23rails
: 6.1graphql-batch
: 0.6.0GraphQL schema
Include relevant types and fields (in Ruby is best, in GraphQL IDL is ok). Any custom extensions, etc?
GraphQL query
Fetch the whole shema in Graphiql
The text was updated successfully, but these errors were encountered: