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

Lack of support for GraphQL Unions and Interface #97

Open
robross0606 opened this issue Sep 16, 2019 · 4 comments
Open

Lack of support for GraphQL Unions and Interface #97

robross0606 opened this issue Sep 16, 2019 · 4 comments

Comments

@robross0606
Copy link

We have need to support Interfaces so a collection may reference a root entity in more than one other collection. I know you don't support this right now. Any suggested workaround at the moment?

@Yogu
Copy link
Member

Yogu commented Sep 17, 2019

Not really sure what you want to achieve - do you want to add a field that sometimes references a root entity in collection A, and sometimes in collection B? How would cruddl decide in which root entity to look it up? The simple workaround would be to add two reference or relation fields.

@robross0606
Copy link
Author

robross0606 commented Sep 17, 2019

Perhaps I worded that incorrectly. From a GraphQL perspective, we have a classic use case for an interface. How that is actually implemented in cruddl and Arango is a different story. I should not really have stipulated the comment about root entity or multiple collections because it wouldn't necessarily need to be implemented that way. I just know we have need to use interfaces which means I either work through or around cruddl. Any workaround I come up with cannot result in a change to the GraphQL API.

@Yogu
Copy link
Member

Yogu commented Sep 17, 2019

Hm... so you basically want to add an abstraction between the public GraphQL API and the storage, right? Currently, I would suggest to just put something between cruddl and the public API - e.g. with graphql-bindings (although I haven't used that myself, so I don't know if it would work).

We're planning to add a pretty big feature to cruddl in the next months: Custom mutations and queries. You will be able to define GraphQL types (input and output types), and then supply a JavaScript / TypeScript function that implements this type. It's still in the design phase, and I can't provide an ETA. But that could also solve some of the problems you're describing in the recent issues.

@henkesn
Copy link
Collaborator

henkesn commented May 18, 2020

Perhaps it would be good to have interfaces to allow fragments on interfaces. Fragments could be reused for several models.

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

No branches or pull requests

3 participants