Skip to content

Improve reference docs on how to find schema files acorss multiple modules #489

Closed
@toinetoine

Description

@toinetoine

I couldn't find anywhere in the documentation (or examples) how to include schema file from imported maven modules.

Background: We have an external project with the entities (models) and pull it in as a maven dependency. The graphqls schema files with the type declarations for each entity lives in that project.

Using legacy GraphQL Java Kickstart it automatically picked up graphqls schema files from maven dependencies (imported jars). Is there a way to do this using new spring-boot-starter-graphql?

I uploaded a demo project showing what we are trying to do. Right now the schema file in the app module is being picked up (highlighted in green) but the schema in the app module's dependency animals module is not being picked up (highlighted in red).
Screenshot from 2022-09-15 16-46-39

When I move the the schema file in the animals module to the app module (renaming it to schema2.graphql) it works.
Screenshot from 2022-09-15 16-46-39_2

I tried using spring.graphql.schema.locations=classpath:/graphql/,BOOT-INF/lib/animals-0.0.1-SNAPSHOT.jar!/graphql/ using the path to the schema files from the jar but it didn't work.
Screenshot from 2022-09-15 16-44-35

Also tried using the default (not specifying in my application properties at all) but didn't work.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions