Skip to content

Possibility to add typename to response projection of GraphQL interface #230

@kobylynskyi

Description

@kobylynskyi

Given GraphQL interface:

interface Character {
    id: ID!
    name: String!
}

It should be possible to specify typename() in the response projection of the interface:

CharacterResponseProjection characterResponseProjection = new CharacterResponseProjection()
                .id()
                .name()
                .onDroid(
                        new DroidResponseProjection()
                        .model())
                .typename();

GraphQLRequest graphQLRequest = new GraphQLRequest(heroesQueryRequest, characterResponseProjection);

so that GraphQL request will look like:

query heroes {
    id
    name
    ...on Droid {
        model
    }
    __typename
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions