This plugin generates an object containing a list of all your GraphQL operations and fragments. This is useful if you are using Apollo-Client and wish to have type validation when you are using
All operations and fragments are being exported by their name (so unnamed operations are being ignored), in the following structure:
Allow you to customize the name of the exported identifier
Will generate a const string instead of regular string.
Include the plugin within your output (into an existing JS/TS file, or a new file), for example:
Now, you should be able to import
namedOperations from that file, and use the names within your code. For example, with Apollo Client, you can do: