Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Question: Is there any way to create GraphQL interfaces? #2212

Closed
ossinkine opened this issue Sep 24, 2018 · 2 comments
Closed

Question: Is there any way to create GraphQL interfaces? #2212

ossinkine opened this issue Sep 24, 2018 · 2 comments
Labels

Comments

@ossinkine
Copy link
Contributor

GraphQL allows to declare abstract types called interfaces (https://graphql.org/learn/schema/#interfaces). On the backed it's mean we can create abstract models.
What is a proper way I should configure my models that API Platform builds a schema with interfaces?

@CvekCoding
Copy link
Contributor

I explored this slightly. I think this is not possible at this moment. This is how interfaces are implemented in WebOnyx https://webonyx.github.io/graphql-php/type-system/interfaces/
I see only one one place where interface creates and only for Node type

public function getNodeInterface(): InterfaceType

@alanpoulain please confirm. If I'm right do you plan to support interfaces for GraphQl? I think this way data model in GraphQl schema will reflect model in php very well. At this moment I have some troubles with this.

@stale
Copy link

stale bot commented Nov 5, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 5, 2022
@soyuka soyuka removed the question label Nov 6, 2022
@api-platform api-platform locked and limited conversation to collaborators Nov 6, 2022
@soyuka soyuka converted this issue into discussion #5133 Nov 6, 2022
@stale stale bot removed the wontfix label Nov 6, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

4 participants