Add reachability metadata for GraphQL client resources

This commit adds reachability metadata for resources loaded by the
`GraphQlClient` and `GraphQlTester` when using the `document("name")`
API variant. This method loads the query file from the classpath at
particular locations, namely `"classpath:graphql-documents/"` and
`"classpath:graphql-test/"` with the `".graphql"` and `".gql"` file
extensions.

This commit adds the relevant resource metadata so that such resources
are loaded in the GraalVM native image at build time when the client or
the tester are reachable through the static analysis.

Fixes gh-575
This commit is contained in:
Brian Clozel
2022-12-09 15:15:37 +01:00
parent 5f1ca8cda3
commit d1300f56bf
2 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
{
"bundles": [],
"resources": {
"includes": [
{
"pattern": "\\Qgraphql-test\/\\E.*\\Q.graphql\\E",
"condition": {
"typeReachable": "org.springframework.graphql.test.tester.GraphQlTester"
}
},
{
"pattern": "\\Qgraphql-test\/\\E.*\\Q.gql\\E",
"condition": {
"typeReachable": "org.springframework.graphql.test.tester.GraphQlTester"
}
}
]
}
}

View File

@@ -0,0 +1,19 @@
{
"bundles": [],
"resources": {
"includes": [
{
"pattern": "\\Qgraphql-documents\/\\E.*\\Q.graphql\\E",
"condition": {
"typeReachable": "org.springframework.graphql.client.GraphQlClient"
}
},
{
"pattern": "\\Qgraphql-documents\/\\E.*\\Q.gql\\E",
"condition": {
"typeReachable": "org.springframework.graphql.client.GraphQlClient"
}
}
]
}
}