Feature: check the schema json/graphql file for git conflict markers
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
It would avoid errors like:
```
➜ example git:(bmw_content) ✗ yarn relay
yarn run v1.13.0
$ relay-compiler --src ./src --schema data/schema.graphql --language typescript --artifactDirectory ./src/__generated__ --persist --persistOutput ./src/__generated__/complete.queryMap.json --exclude '**/node_modules/**,**/__mocks__/**,**/__generated__/**'
Error: Error loading schema. Expected the schema to be a .graphql or a .json
file, describing your GraphQL server's API. Error detail:
GraphQLError: Syntax Error: Cannot parse the unexpected character "<".
at syntaxError (/Users/kierangillen/code/emission/node_modules/graphql/error/syntaxError.js:24:10)
at readToken (/Users/kierangillen/code/emission/node_modules/graphql/language/lexer.js:302:32)
at Object.lookahead (/Users/kierangillen/code/emission/node_modules/graphql/language/lexer.js:61:43)
at Object.advanceLexer [as advance] (/Users/kierangillen/code/emission/node_modules/graphql/language/lexer.js:52:33)
at expect (/Users/kierangillen/code/emission/node_modules/graphql/language/parser.js:1296:11)
at parseName (/Users/kierangillen/code/emission/node_modules/graphql/language/parser.js:92:15)
at parseNamedType (/Users/kierangillen/code/emission/node_modules/graphql/language/parser.js:630:11)
at parseTypeReference (/Users/kierangillen/code/emission/node_modules/graphql/language/parser.js:611:12)
at parseFieldDefinition (/Users/kierangillen/code/emission/node_modules/graphql/language/parser.js:812:14)
at many (/Users/kierangillen/code/emission/node_modules/graphql/language/parser.js:1350:16)
at getSchema (/Users/kierangillen/code/emission/node_modules/relay-compiler/bin/relay-compiler:345:12)
at /Users/kierangillen/code/emission/node_modules/relay-compiler/bin/relay-compiler:123:19
at Generator.next ()
at step (/Users/kierangillen/code/emission/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/kierangillen/code/emission/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:68:7)
error Command failed with exit code 1.```
```
This would be a good first issue for someone interested in contributing.
Contributor guide
Research direction
Start by tracing relay-compiler's schema loading for the --schema data/schema.graphql input, including JSON and GraphQL files. Reproduce the shown yarn relay failure with conflict markers, then verify that the compiler reports the marker before attempting to parse the schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100