Comments (10)
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.
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.
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.
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.
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.
So you use one single schema file for the whole API and commit it to git?
from graphql-inspector.
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.
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.
Yes + we get Intellisense in IDEs thanks to that
from graphql-inspector.
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)
- Security issue because of @babel/core package HOT 2
- Some headers are incorrectly parsed HOT 5
- Create a better message structure for all commands
- Resource not accessible by integration HOT 6
- Support for Arm64 container builds
- Improve breaking change detection when GraphQL documents are available
- Use templates for messages of changes to be able to render them in different formats
- commands with --federation not working. HOT 2
- Validate Command doesn't show in which file we are querying the deprecated field HOT 2
- Passing the require flag within a Github Action HOT 1
- Add changes result to Github Action output
- Documentation missing for `--ignore` in the `validate` command HOT 1
- Validate fails if "..." occurs within a string in a query
- audit command doesn't work with ci package
- graphql query depth doesn't match graphql-armor calculation
- query depth for validate does not match audit
- Make Inspector - Validate error Parsable
- graphql-inspector cli diff fails to read from shell plumbing
- graphql-inspector actions are displayed as if they are continuously running HOT 1
- nodejs version 16 has been discontinued HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-inspector.