You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.
Working on a project that uses primarily the gql tagged template literal for defining queries, but .graphql|.gql files for defining fragments.
Currently persistgraphql seems to be an either-or proposition. If you pass in the --js --extension=js arguments, the fragments aren't in the docMap, and as a result the following throws
export function isOperationDefinition(defn: DefinitionNode): defn is OperationDefinitionNode {
return (defn.kind === 'OperationDefinition');
}
Trace:
TypeError: Cannot read property 'kind' of undefined
at isOperationDefinition (/Users/mergebandit/dev/super-top-secret-but-totes-badass-project/node_modules/persistgraphql/lib/src/extractFromAST.js:5:17)
at Array.filter (<anonymous>)
at Object.getOperationDefinitions (/Users/mergebandit/dev/super-top-secret-but-totes-badass-project/node_modules/persistgraphql/lib/src/extractFromAST.js:46:28)
at ExtractGQL.createMapFromDocument (/Users/mergebandit/dev/super-top-secret-but-totes-badass-project/node_modules/persistgraphql/lib/src/ExtractGQL.js:70:49)
at /Users/mergebandit/dev/super-top-secret-but-totes-badass-project/node_modules/persistgraphql/lib/src/ExtractGQL.js:99:26
at Array.map (<anonymous>)
at ExtractGQL.createOutputMapFromString (/Users/mergebandit/dev/super-top-secret-but-totes-badass-project/node_modules/persistgraphql/lib/src/ExtractGQL.js:95:46)
at /Users/mergebandit/dev/super-top-secret-but-totes-badass-project/node_modules/persistgraphql/lib/src/ExtractGQL.js:132:31
at <anonymous>
Seems to me that, if you choose the .js argument, it should still be able to extract .graphql files and merge them into the output document mapping.
The text was updated successfully, but these errors were encountered:
Working on a project that uses primarily the
gql
tagged template literal for defining queries, but.graphql|.gql
files for defining fragments.Currently persistgraphql seems to be an either-or proposition. If you pass in the
--js --extension=js
arguments, the fragments aren't in the docMap, and as a result the following throwsextractFromAST
Trace:
Seems to me that, if you choose the
.js
argument, it should still be able to extract.graphql
files and merge them into the output document mapping.The text was updated successfully, but these errors were encountered: