Comments (7)
yeah, OS turns glob into an array of files
from graphql-inspector.
@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.
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.
I'll see if it's something done by graphql-inspector
or graphql-toolkit
(a dependency)
from graphql-inspector.
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.
I think you need to wrap the parameter in quotes. like this
graphql-inspector validate "./src/**/*.{ts,tsx}" ./graphql/allSchema.graphql
from graphql-inspector.
@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)
- Inspector action incorrectly uses first run when there's multiple runs referencing the same git commit
- Test
- Diff does not identify changes in schema directives HOT 1
- Allow for use of Wildcards when using the Github Action HOT 1
- Diff does not identify changes in default values
- ‼️ GraphQL Inspector - Deprecated GitHub Application HOT 1
- Project Roadmap
- Suggest PR Label to Bypass Breaking Change Check HOT 1
- validate doesn't work when fragments are stored in another file HOT 2
- 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
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.