-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't override an existing field with an object type #3788
Comments
Hi @mbrowne , I had a quick look. I have been able to get your example working by using the filter-schema transform in transforms:
- filterSchema:
filters:
- Author.!name To this: transforms:
- filterSchema:
mode: bare
filters:
- Author.!name
Having said that, this will allow you to hopefully get going, but I believe the team will still want to look into the origin of the clash and whether there is feasibility for improving there. |
Thanks for the quick reply. This works for a local schema, but as soon as I change it to use But it's fine; I can wait until the underlying issue is resolved - thanks! |
The underlying issue is surely going to be complex and it won't necessarily be feasible to solve. If you filter out the If your goal is to query for the original Your codesandbox can no longer be used for this, if you need to point to an actual data source in order to replicate your real needs. |
Could you add another source(it can be a dummy one) and try again? |
Thanks for the tips. The interesting thing is that it worked with just the local source, but as soon as you add even one external graphql source, it no longer fetches the - name: SpaceX
handler:
graphql:
endpoint: https://api.spacex.land/graphql/ And when both are external sources, even this no longer works:
(I get I could create a demo branch in github if that's helpful. I'm not sure if I would be able to use |
Issue workflow progress
Progress of the issue based on the Contributor Workflow
1. The issue provides a reproduction available on CodeSandbox
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
additionalTypeDefs
can be used to change the type of a field in a GraphQL source schema (together with the filter transform to remove the original field), but only if it's a primitive field. If you try to set it to an object type, it fails with this error:To Reproduce
Steps to reproduce the behavior:
Open this CodeSandbox:
https://codesandbox.io/s/modest-lehmann-2uzylv
Run this query:
Expected behavior
The
name
field should be overridden with the new type,TextDisplayField
.Environment:
The text was updated successfully, but these errors were encountered: