Open bjoernmayer opened 1 month ago
Hello @bjoernmayer
Yes that's correct, those are meant to be locations, not fully resolved resources. I'm not sure I understand the use case though. Why point directly to resources and not locations? Are there schema resources in the same location that are not meant to be used? Why?
Hi @bclozel, thank you for looking into this.
The main reason is Federation.
We are working with subgraphs in a Mono Repository. We have all of our shared types in a shared library. Each subgraph then picks only the types, that it needs and should expose in its schema.
Spring for GraphQL provides a org.springframework.graphql.execution.GraphQlSource.SchemaResourceBuilder#schemaResources
that lets you configure specific schema files.
You can already declare specific resources in your application by contributing a GraphQlSourceBuilderCustomizer
bean to your application and add resources manually.
I'll move this issue to Spring Boot to consider a separate configuration property that would let you set additional schema resources on top of scanned ones.
Hello could you please give me this task for me
@jack5505 thanks for the proposal but this is targeted for the next minor version and we haven't started working on this yet.
Heyho,
it seems like there is currently no way to specify schema files by their filename. Instead it is only possible to configure directories.
From GraphqlProperties.java:
Hence this is impossible:
I encountered this obstacle when trying to migrate from DGS to Spring GQL