Ensure unique OperationName for each GraphQL query and mutation
This is preparation for GraphQL queries as named "stored procedures" - the frontend can use shorthand to refer to a
If we can set a unique title for each query and mutation, it means we can set the foundation for the following:
- Sending a shorthand and variables so that we save and cache queries a bit like stored procedures
- Define a SSOT for query contents to share between frontend and backend
- Allow greater visibility in our monitoring by grouping queries by name
Titles should be unique and present for each query and mutation. This can probably be done via a linter.
Possible solution
-
Lint using https://github.com/apollographql/eslint-plugin-graphql<-- This appears to be stagnant. - Lint using
graphql-eslint
'sunique-operation-name
rule
Edited by Mark Florian