Skip to content
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

Polymorphic input types #238

Open
oojacoboo opened this issue Feb 7, 2020 · 4 comments
Open

Polymorphic input types #238

oojacoboo opened this issue Feb 7, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@oojacoboo
Copy link
Collaborator

I'd like to go ahead and present this RFC for implementation, possibly early as it looks to have full support. Or, at the least, I'd like to get the discussion and ideas flowing for implementation in the future.

https://github.com/graphql/graphql-spec/blob/master/rfcs/InputUnion.md

This is particularly of interest in cases where you have an update mutation that has optional relational inputs. In this case, you have to support creating and updating for the relation. It's also the case for one:many relationships, if you wish to update relations within a parent mutation.

There are a number of other use cases that are also important. The above use case is one that we're finding to be very common and a continual frustration point with the API/schema.

@moufmouf
Copy link
Member

moufmouf commented Feb 8, 2020

I do understand your frustration.

GraphQLite uses webonyx/graphql-php under the hood for schema generation and GraphQL parsing.
I'm all in favor of implementing polymorphic input types but we need first to have it supported by webonyx/graphql-php. So I think you should first open an issue with them.

Once it is supported in webonyx/graphql-php, it to GraphQLite should be quite easy.

@oojacoboo
Copy link
Collaborator Author

The issue has been filed with webonyx now.

webonyx/graphql-php#619

@oojacoboo oojacoboo added the enhancement New feature or request label Mar 29, 2021
@noknokcody
Copy link

Been 4 years since this was posted so I'd be keen to see if there's any updates to this ? Been a good point of frustration for me aswell. Currently trying to make some form of workaround using a custom RootTypeMapper.

@oojacoboo
Copy link
Collaborator Author

@noknokcody submit a PR with webonyx, then we can get a PR merged here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants