Import graphql schema from parent module in spring boot

285 Views Asked by At

I am trying to import my schema definition files from a parent module which is imported in maven. The schema files exist under resources in my parent jar file, is there a way to import those schema files in my child project? I can copy the files from the parent jar using the maven plugin but that doesn't seem right, is there another way? here is graphqlconfig file in parent project

{
  "projects": {
    "a": {
      "includes": [
        "schema-a/**"
      ]
    },
    "b": {
      "includes": [
        "schema-b/**"
      ]
    }
  }
}

how do I import and refer to these schema files in my child project? I am using netflix dgs with spring boot in case that helps.

Thanks

1

There are 1 best solutions below

0
On

dgs: graphql: schema-locations: classpath*:schema/**/*.graphqls fixes the issue