Code Monkey home page Code Monkey logo

Comments (10)

kamilkisiela avatar kamilkisiela commented on June 15, 2024 1

It might be hard to implement or even impossible because we use Github's API to fetch files and it doesn't support glob patterns. Maybe there's a way to workaround and something like search results + file fetching would work.

from graphql-inspector.

steebchen avatar steebchen commented on June 15, 2024

Interesting, didn't know that. The problem is that I split my schema files into multiple paths to keep it organized, and even when I would use graphql-inspectors's CLI to generate a single schema, graphql-inspector-github should annotate the original file but probably couldn't even annotate the generated file.

from graphql-inspector.

kamilkisiela avatar kamilkisiela commented on June 15, 2024

The thing is, GraphQL Inspector App or Action doesn't understand how to annotate schema when there are multiple .graphql files. That's why it requires a single .graphql.

As a workaround you can do:

$ graphql-inspector introspect path/to/files/*.graphql --write schema.graphql

This will merge .graphql files turn that into Schema and print the output.

from graphql-inspector.

steebchen avatar steebchen commented on June 15, 2024

I understand, I will just stick with the normal CLI in my opinion the Github Action does not provide any more functionality if you don't have anything in a single schema file which I doubt is the normal case even for small apps. Don't get me wrong though, I am really thankful for having graphql-inspector in my CI (also for queries for the client-side).

from graphql-inspector.

kamilkisiela avatar kamilkisiela commented on June 15, 2024

We use it as part of git hook in pretty much all of our client's apps, some reaches millions of people per month with huge codebases and GraphQL Schemas.

Git hook runs $ graphql-inspector introspect or sometimes $ graphql-codegen --config codegen-introspect.yml and developers are happy. They see what has changed because it's in one file (bitbucket) and they get annotations (github).

from graphql-inspector.

steebchen avatar steebchen commented on June 15, 2024

So you use one single schema file for the whole API and commit it to git?

from graphql-inspector.

kamilkisiela avatar kamilkisiela commented on June 15, 2024

We have Schema defined in multiple places, usually within .graphql or .ts files but we extract that into a single file with git hook. Just for GraphQL Inspector and some codegen things.

from graphql-inspector.

steebchen avatar steebchen commented on June 15, 2024

Okay, and I assume that file is committed into git so that graphql-inspect-github can annotate the code inline, right? Otherwise, I don't see a reason to commit a full schema.graphql(s) because codegen handles globs fine (at least for the client, I'm using a different codegen lib for the GraphQL server).

from graphql-inspector.

kamilkisiela avatar kamilkisiela commented on June 15, 2024

Yes + we get Intellisense in IDEs thanks to that

from graphql-inspector.

steebchen avatar steebchen commented on June 15, 2024

Got it, thanks. Actually we get that too without generating the extra schema.graphqls, we use IntelliJ with the GraphQL extension and you can just specify globs for your schema files such as api/**/*.graphqls in the .graphqlconfig. Works perfectly for type checking, highlighting, "go to definition", "show usages", etc.

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.