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

interfaces shouldn't need concrete implementations to be referred to in the schema #42

Open
schveiguy opened this issue Jan 28, 2020 · 0 comments

Comments

@schveiguy
Copy link
Contributor

Example:

@GQLDUda(TypeKind.INTERFACE)
abstract class I
{
    string name;
}

class C1 : I
{
    long val;
}

class C2 : I
{
    string val;
}

struct SubType
{
    I getc1();
    I getc2();
}

struct Query
{
    SubType subType();
}

class Schema
{
    Query queryType;
}

If I do a query like:

query {
    subType {
      getc1 {
          ... on C1 {
              val
          }
    }
}

I get an error that type C1 is not recognized in the schema. I have to add some dummy values in the schema to get the introspection to work:

struct SubType
{
    NullableStore!C1 c1dontuse;
    NullableStore!C2 c2dontuse;
    I getc1();
    I getc2();
}

the library should provide a mechanism (probably a UDA) that adds concrete types for interfaces.

@burner burner closed this as completed in 39e9875 Jan 30, 2020
@burner burner reopened this Jan 30, 2020
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

2 participants