DiamondLightSource / DiamondLightSource/graph-federation
Latest schema does not autogenerate types
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
When trying to generate types against the schema produced in https://github.com/DiamondLightSource/graph-federation/actions/runs/30467711235/job/90629700962 using the documentation from https://github.com/DiamondLightSource/atlas/tree/main/apps/i15-1#updating-supergraph-schema-types I got an error of:
```
❯ Generate to ./src/graphql/__generated__/
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ OneOf input field JSONOperator.datetimeOperator cannot have a default value.
OneOf input field JSONOperator.numericOperator cannot have a default value.
OneOf input field JSONOperator.stringOperator cannot have a default value.
❯ Generate to ./src/
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ OneOf input field JSONOperator.datetimeOperator cannot have a default value.
OneOf input field JSONOperator.numericOperator cannot have a default value.
OneOf input field JSONOperator.stringOperator cannot have a default value.
```
Copilot tells me that this is indeed correct that `OneOf` is not allowed default values. The issue can be seen from https://github.com/DiamondLightSource/graph-federation/blob/3895062885531fda9720583ac5c017b7ef6506c2/schema/samples.graphql#L111
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at schema/samples.graphql around line 111 and compare the JSONOperator OneOf fields with the GraphQL OneOf rules described by the generation error. Follow the linked schema-generation documentation, rerun type generation against the affected schema, and consider the issue done when both generation steps complete without default-value errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100