GithubHelp home page GithubHelp logo

Comments (7)

kamilkisiela avatar kamilkisiela commented on June 14, 2024 1

yeah, OS turns glob into an array of files

from graphql-inspector.

MrDesjardins avatar MrDesjardins commented on June 14, 2024

@kamilkisiela I see that the issue is marked as "enhancement". While having more context about what is wrong is an enhancement, I believe that there is also a bug. The GraphQL schema is valid and in production at the moment. The toolings around the schema (Playground, Voyageur, etc) are all consuming the GraphQL schema without issue as well as the Express server that host the Apollo Server and the consumer code who build the gql. However, the graphql-inspector fails.

I'll get the source code of graphql-inspector and try to diagnostic the library. I'll post my finding.

from graphql-inspector.

MrDesjardins avatar MrDesjardins commented on June 14, 2024

Update: I've done some test and here is something very odd.

I moved the gql into a .ts file and have the .tsx files importing the gql.

This command:

./node_modules/.bin/graphql-inspector validate ./src/**/*.ts ./graphql/allSchema.graphql
./node_modules/.bin/graphql-inspector validate ./src/**/*.tsx ./graphql/allSchema.graphql

Output:

success All documents are valid
success All documents are valid

However, this is wrong because I explicitly wrote fake/bad graphQL query into the gql tag.

If I change the command to:

./node_modules/.bin/graphql-inspector validate ./src/**/*.{ts,tsx} ./graphql/allSchema.graphql

I get:

error All found files for glob expression "./src/**/*.tsx" are not valid or empty, please check it and try again!

On the former, I expect that it returns an issue on the .ts file. One the latter, I was expecting the same output than the first command.

from graphql-inspector.

kamilkisiela avatar kamilkisiela commented on June 14, 2024

I'll see if it's something done by graphql-inspector or graphql-toolkit (a dependency)

from graphql-inspector.

MrDesjardins avatar MrDesjardins commented on June 14, 2024

Also, concerning the former issue. Moving the GraphQL into a .graphql file instead of having it directly into a .ts or .tsx file fixed the issue.

./node_modules/.bin/graphql-inspector validate ./src/**/*.graphql ./graphql/allSchema.graphql

So, it seems that analyzing ts/tsx file causes an issue while the same query in a graphql file works as expected.

from graphql-inspector.

leethree avatar leethree commented on June 14, 2024

I think you need to wrap the parameter in quotes. like this

graphql-inspector validate "./src/**/*.{ts,tsx}" ./graphql/allSchema.graphql

from graphql-inspector.

kamilkisiela avatar kamilkisiela commented on June 14, 2024

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

from graphql-inspector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.