What is operationName used for? #7

Closed
opened 2018-02-13 22:07:22 +08:00 by teckays · 2 comments
teckays commented 2018-02-13 22:07:22 +08:00 (Migrated from github.com)

I am getting an error like GraphQLError: Unknown operation named "..."

I've noticed the object passed to the GraphQL server consists of:

{
    operationName: "...",
    query: "...",
    variables: { ... }
}

why operationName is passed when it should only send query and variables?

I am getting an error like `GraphQLError: Unknown operation named "..."` I've noticed the object passed to the GraphQL server consists of: ``` { operationName: "...", query: "...", variables: { ... } } ``` why `operationName` is passed when it should only send `query` and `variables`?
gucheen commented 2018-02-16 17:14:01 +08:00 (Migrated from github.com)

@teckays You can refer to GraphQL Docs http://graphql.org/learn/queries/#operation-name

The operation name is a meaningful and explicit name for your operation.

@teckays You can refer to GraphQL Docs [http://graphql.org/learn/queries/#operation-name](http://graphql.org/learn/queries/#operation-name) > The operation name is a meaningful and explicit name for your operation.
teckays commented 2018-02-21 16:14:18 +08:00 (Migrated from github.com)

Git it! Thank you

Git it! Thank you
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gucheen/fetchql#7
No description provided.