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

bug: ProjectionRoot client class not generated for Connection query

Open RuiLoureiro opened this issue 4 years ago • 6 comments

Expected behavior

With the following schema:

type Query {
      something: MovieConnection
}

type Movie @connection {
    movieID: ID
    title: String
}

and the generateClient option set to true, I was expecting the SomethingProjectionRoot.java class to be generated under the client package.

Actual behavior

Only the SomethingGraphQLQuery.java class is being generated under the client package.

The SomethingProjectionRoot.java class does get generated if I add the MovieConnection type to my schema file:

type MovieConnection {
    edges: [MovieEdge]
    pageInfo: PageInfo
}

Steps to reproduce

A minimal reproducible example is in https://github.com/RuiLoureiro/dgs-pagination-bug

RuiLoureiro avatar Jan 21 '22 20:01 RuiLoureiro

The @connection directive is processed at run time to generate the appropriate connection types. Codegeneration is therefore not aware of these types since it works with static schema. We will need to enhance codegen to add this functionality. Thanks for reporting!

On Fri, Jan 21, 2022 at 12:25 PM RuiLoureiro @.***> wrote:

Expected behavior

With the following schema:

type Query { something: MovieConnection } type Movie @connection { movieID: ID title: String }

and the generateClient option set to true, I was expecting the SomethingProjectionRoot.java class to be generated under the client package. Actual behavior

Only the SomethingGraphQLQuery.java class is being generated under the client package.

The SomethingProjectionRoot.java class does get generated if I add the MovieConnection type to my schema file:

type MovieConnection { edges: [MovieEdge] pageInfo: PageInfo }

Steps to reproduce

A minimal reproducible example is in https://github.com/RuiLoureiro/dgs-pagination-bug

— Reply to this email directly, view it on GitHub https://github.com/Netflix/dgs-framework/issues/833, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ5JPXLKL24Q2NB3QMTPVQLUXG6KNANCNFSM5MQO455Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

srinivasankavitha avatar Jan 21 '22 20:01 srinivasankavitha

@srinivasankavitha, Is there any progress on this? According to the documentation, this might have already been implemented. https://netflix.github.io/dgs/advanced/relay-pagination/#configuring-code-generation However, the same class was not generated for me.

karaimin avatar Jun 28 '22 13:06 karaimin

if I add the MovieConnection type to my schema file

I found this solution will have problem with @shareable in apollo federation 2.

Rfank2021 avatar Aug 04 '22 09:08 Rfank2021

@srinivasankavitha, Is there any progress on this? According to the documentation, this might have already been implemented. https://netflix.github.io/dgs/advanced/relay-pagination/#configuring-code-generation However, the same class was not generated for me.

If you are looking for the type mapping, could you try out the recommended mapping?

srinivasankavitha avatar Aug 15 '22 23:08 srinivasankavitha

We haven't yet worked through adding explicit support for apollo federation 2, so I do expect a few of our existing features will need to be reworked.

srinivasankavitha avatar Aug 15 '22 23:08 srinivasankavitha