Reject directives applied at the wrong location, without a required argument or twice in 15.0.0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design, release, testing
Research direction
Start with SchemaParser#directiveProblems and SchemaParser#directivesOf, then read DirectiveTest.should warn about invalid applied directives and keep them. Replace the warnings with SchemaError using the same messages, and cover the type extension case for duplicate non-repeatable directives. Update the 15.0.0 release notes; done when invalid applications fail with the expected errors and the test and release notes describe the change.
Written by the indexing model from the issue text.
Description
Since #225, tools logs a warning when a schema applies a directive in a way its definition doesn't allow, and still builds the schema:
directive @uppercase on OBJECT
directive @auth(role: String!) on FIELD_DEFINITION
directive @cached(ttl: Int) on FIELD_DEFINITION
type Query {
motto: String @uppercase
secret: String @auth
members: [Member!] @cached @cached(ttl: 10)
}
Directive @uppercase is applied to field 'Query.motto', but it's declared on OBJECT, not FIELD_DEFINITION.
Directive @auth is applied to field 'Query.secret' without its required argument 'role'.
Directive @cached isn't repeatable but is applied more than once to field 'Query.members'.
graphql-java's SchemaGenerator rejects all three, and the spec doesn't allow them either. But they always built with tools, so failing on them has to wait for a major release.
What to change
- replace the warnings from
SchemaParser#directiveProblemswith aSchemaErrorthat has the same messages - probably do the same for the warning in
SchemaParser#directivesOf, when a type extension applies a non-repeatable directive the type already has. It's the same mistake, it just drops the repeat today - turn
DirectiveTest.should warn about invalid applied directives and keep theminto a test for the error - mention it in the 15.0.0 release notes
- Dominant language
- Kotlin
- Stars
- 824
- Forks
- 175
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 52
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from graphql-java-kickstart/graphql-java-tools
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
Maintainers usually reply within 1 day
-
Directive wirings see a type reference on recursive input fieldsPossibly taken @oryan-block claimed this today. Openbug
Difficulty 5/5 Over a week Newbie friendliness 35/100
graphql-java-kickstart/graphql-java-tools#875 ·
Maintainers usually reply within 1 day
All issues in graphql-java-kickstart/graphql-java-tools
Similar issues
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
dafonton77-tech/Cadreenf#11 ·
-
design good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
scribe-org/Scribe-Android#739 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
ssalggnikool/Navic#688 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
xybrid-ai/xybrid#661 · 1 comment ·
Maintainers usually reply within 1 day
-
help wanted needs-device
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
shayann07/liquidglass#74 ·
Maintainers usually reply within 1 day