Error: was filtered because it contains an invalid GraphQL schema definition
See original GitHub issueHello,
I have a running client that consume a GraphQL service. I can query without any issue. I am trying to use the graphql-inspector but this one keeps saying:
was filtered because it contains an invalid GraphQL schema definition
I am using:
./node_modules/.bin/graphql-inspector validate ./src/**/*.{ts,tsx} ./graphql/allSchema.graphql
and the result is
File “./src/Shared/ContainerComponents/GraphQLExperimentation1.tsx” was filtered because it contains an invalid GraphQL schema definition! File “./src/Shared/ContainerComponents/GraphQLExperimentation2.tsx” was filtered because it contains an invalid GraphQL schema definition!
error All found files for glob expression “./src/**/*.tsx” are not valid or empty, please check it and try again!
It would be helpful to know what “invalid” means? Meanwhile, is there an option to get further detail because from my perspective the schema is valid. The VSCode extension (GraphQL for VSCode) uses the static file ./graphql/allSchema.graphql
and does not detect any issue. The execution of the query is also flawless.
The two .tsx files are different. The first one uses:
const result: ApolloQueryResult<Proto.Query> = await this.client.query<Proto.Query>({
query: gql`
query Proto {
entityA(id: 1) {
name
id
}
}
`
});
The second one use:
<Query
query={gql`
query Proto2 {
entityA(id: 1) {
name
id
}
}
`}
>
Thank you in advance.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
yeah, OS turns glob into an array of files
@MrDesjardins we did some work libraries that GraphQL Inspector depends on, could you check if
1.22.1
works for you?