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

ConnectionTypeDefinitionConfigurer should consider object type extensions #816

Closed
ooraini opened this issue Sep 18, 2023 · 1 comment
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@ooraini
Copy link

ooraini commented Sep 18, 2023

ConnectionTypeDefinitionConfigurer only considers types in the TypeDefinitionRegistry, type extensions are not considered. For example the following throws an exception on startup((The field type 'CompanyConnection' is not present when resolving type 'Query')):

extend type Query {
    company(id: ID!): Company
    companies(offset: Int!, limit: Int!): CompanyConnection
}

Note the extend.

Type extensions are available on the TypeDefinitionRegistry and their fields can be accessed as follows:

registry.objectTypeExtensions().values().stream()
                .flatMap(Collection::stream)
                .flatMap(it -> it.getFieldDefinitions().stream())
                .map(fieldDefinition -> {...})
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 18, 2023
@rstoyanchev rstoyanchev self-assigned this Sep 18, 2023
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 18, 2023
@rstoyanchev rstoyanchev added this to the 1.2.3 milestone Sep 18, 2023
@rstoyanchev rstoyanchev changed the title Consider object extensions in ConnectionTypeDefinitionConfigurer ConnectionTypeDefinitionConfigurer should consider object type extensions Sep 18, 2023
@rstoyanchev
Copy link
Contributor

Thanks for the report. I've made the adjustment in time for tomorrow's release.

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

No branches or pull requests

3 participants