dotansimha / graphql-yoga

🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
https://the-guild.dev/graphql/yoga-server
MIT License
8.25k stars 574 forks source link

apollo-usage-report - get missing operationName from the OperationDefinitionNode #3488

Open kroupacz opened 5 days ago

kroupacz commented 5 days ago

Description

If someone send GraphQL query without operationName in request body, we should try to get it from the OperationDefinitionNode after the query parsing is finished.

I added this logic to the onParse (onParseEnd) handler, but I'm not sure if all the logic of the onEnveloped handler should be moved to the onParseEnd handler?

changeset-bot[bot] commented 5 days ago

🦋 Changeset detected

Latest commit: 896bea9fd758c5619cb622c95bdbe4bd599a532e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------------------------------- | ----- | | @graphql-yoga/plugin-apollo-usage-report | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

kroupacz commented 2 days ago

@EmrysMyrddin or @ardatan 🙏