ardatan / ardatan/graphql-tools

Query does not provide a operation name as a property in the request body causing some server configurations to reject the request

Open
#5,840 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.4k
Forks
830
Avg merge
10h 59m
Merged PRs (30d)
45

Description

The [Apollo implementation](https://github.com/ardatan/graphql-tools/blob/64cbe00c702529bca8a6277bbafc5f20bcb5d8e9/packages/loaders/apollo-engine/src/index.ts#L24) for fetching the schema does not provide an operation name in the boy of the request like so.
```json
{
"query":"SCHEMA_QUERY",
"variables":{
"id":"options.graph",
"tag":"options.variant"
},
"operationName":"GetSchemaByTag"
}
```
It is common practice to reject queries without an operation names for a variety of reasons. Apollo Server/Federation implementation only exposes the operationName defined in the request body for plugins not in the query causing any teams enabled or created a plugin to reject queries without OperationNames to reject the introspection query.

Contributor guide

Open the contributing guide

Research direction

Start in packages/loaders/apollo-engine/src/index.ts at the linked schema-fetching implementation and compare its request body with the example in the issue. Confirm the request includes the operationName value GetSchemaByTag, then check the loader's existing validation or test coverage if available and verify the request is accepted by configurations that require operation names.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.