question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: was filtered because it contains an invalid GraphQL schema definition

See original GitHub issue

Hello,

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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilkisielacommented, Jul 31, 2019

yeah, OS turns glob into an array of files

0reactions
kamilkisielacommented, Aug 9, 2019

@MrDesjardins we did some work libraries that GraphQL Inspector depends on, could you check if 1.22.1 works for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

was filtered because it contains an invalid GraphQL document ...
Hi, Can you tell me what is wrong here ? I run the codegen. And I get lots of errors, but my graphql...
Read more >
Error handling - Apollo GraphQL Docs
The GraphQL operation string contains a syntax error. GRAPHQL_VALIDATION_FAILED. The GraphQL operation is not valid against the server's schema.
Read more >
GraphQL API style guide - GitLab Docs
GraphQL allows fields to be “nullable” or “non-nullable”. The former means that null may be returned instead of a value of the specified...
Read more >
Example Queries - Tableau Help
The GraphQL schema tells you what queries are allowed. The schema defines the objects, object types, and attributes that you can get from...
Read more >
Queries and Mutations - GraphQL
If you have a sharp eye, you may have noticed that, since the result object fields match the name of the field in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found