dgs-framework icon indicating copy to clipboard operation
dgs-framework copied to clipboard

bug: Generated client should deserialize PageInfo as DefaultPageInfo out-of-the-box

Open chatoooo opened this issue 3 years ago • 1 comments

Consider this schema


type PageInfo {
    startCursor: String
    endCursor: String
    hasNextPage: Boolean!
    hasPreviousPage: Boolean!
}

type Entity {
    id: ID!
    name: String!
}

type EntitiesResult {
    entities: [Entity!]!
    pageInfo: PageInfo
}
   
type Query {
    getEntities(): EntitiesResult!
}

Expected behavior

When you use the generated client (generateClient=true) and the client deserializes the result then EntitiesResult should contain PageInfo data

Actual behavior

Deserialization throws exception com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `graphql.relay.PageInfo` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information

chatoooo avatar Feb 04 '22 15:02 chatoooo

@chatoooo - Thanks for reporting. This issue actually belongs in dgs-codegen. Would you be able to report a bug in this repo: https://github.com/Netflix/dgs-codegen/issues ?

srinivasankavitha avatar Feb 04 '22 18:02 srinivasankavitha