spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.52k stars 300 forks source link

Schema Inspection shows unmapped fields for QueryDsl and QueryByExample auto registrations #970

Open miller79 opened 4 months ago

miller79 commented 4 months ago

I am using Spring Boot Parent 3.2.5 and a repository defined like the following:

@GraphQlRepository
public interface AssetRepository extends CrudRepository<Asset, Long>, QueryByExampleExecutor<Asset> {
}

I also have a graphqls schema that looks like the following:

type Query {
    assets(asset: AssetInput!): [Asset]
}

input AssetInput {
    assetuid: ID
    assetnum: String
}

type Asset {
    assetuid: ID
    assetnum: String
}

When I run the code, it works fine and returns results as expected. However the GraphQL schema inspection shows a log that shows this:

GraphQL schema inspection:
    Unmapped fields: {Query=[assets]}
    Unmapped registrations: {}
    Skipped types: []

If I register the data fetcher directly, the inspection does not show the error but from reading the docs and from monitoring the behavior, I would believe that it is configured appropriately and everything should be configured correctly. I'm not sure if this is a bug or an error on my part but wanted to create an issue here as I could not find similar issues.

Also the documentation doesn't have a really clear example of getting QBE working but with trial and error I came to this implementation so if my knowledge is incorrect please correct me.

rstoyanchev commented 4 months ago

Thanks for the report. It looks like the AutoRegistrationRuntimeWiringConfigurer performs deferred registrations through a WiringFactory rather than directly on RuntimeWiring.Builder, and as a result schema inspection is not aware of such auto-registered DataFetchers.