Error: Type abc was defined more than once.
See original GitHub issueHi,
I am facing some strange issue when running linter on multiple graphql schema. I have multiple schema in my directory. I can have same type/enum there when we consider two schema files. If one schema has “abc” type then second schema can also have same type.
This is my configuration to run linter:
"lint-staged": {
"modules/*/graphql-schema/consolidate.gql": [
"graphql-schema-linter"
]
},
"graphql-schema-linter": {
"rules": [
"defined-types-are-used"
]
}
In case of, for example type abc
exists in two schema files then I am getting an error when running linting. Can we avoid this by defining any rules ?
Error: Type "abc" was defined more than once.
at buildASTSchema (C:\Users\ajaysaini\AppData\Local\Yarn\config\global
ode_modules\graphql\utilities\buildASTSchema.js:111:17)
at validateSchemaDefinition (C:\Users\ajaysaini\AppData\Local\Yarn\config\global
ode_modules\graphql-schema-linter\lib\validator.js:18:51)
at run (C:\Users\ajaysaini\AppData\Local\Yarn\config\global
ode_modules\graphql-schema-linter\lib\runner.js:51:54)
at Object.<anonymous> (C:\Users\ajaysaini\AppData\Local\Yarn\config\global
ode_modules\graphql-schema-linter\lib\cli.js:15:32)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
× graphql-schema-linter found some errors. Please fix them and try committing again.
at Function.Module.runMain (module.js:609:10)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to fix Error: Type "Extra" was defined more than once in ...
SOLUTION. Problem corrected using the concept of interfaces and defining types in the same file. const resolvers = require('.
Read more >SML/NJ Error Messages
This error occurs when type constructors with incompatible equality properties are equated by sharing constraints. When this happens, the signature is not ...
Read more >Statistics: What are Type 1 and Type 2 Errors? - AB Tasty
Type 1 errors – often assimilated with false positives – happen in hypothesis testing when the null hypothesis is true but rejected.
Read more >Resolve the "Parameter validation failed" error in AWS ...
When I create or update my AWS CloudFormation stack, I get the following error: "Parameter validation failed: parameter value 'abc' for ...
Read more >Common issues and solutions - mypy 0.991 documentation
Redefinitions with incompatible types Each name within a function only has a single 'declared' type. You can reuse for loop indices etc., but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added some clarity around
lint-staged
to theREADME
in https://github.com/cjoudrey/graphql-schema-linter/commit/a23434eef7a56e100911809a875daac33df7520c to cover the above issue.I’m going to close this issue for now. Feel free to re-open if you think this is still a problem.
Before adding a new option flag to support multiple schemas to
graphql-schema-linter
I’d like to make sure this is a common use-case as it will add complexity.In the meantime a workaround could be to define them each individually in
lint-staged
: