Skip to content

Commit d1300f5

Browse files
committed
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
1 parent 5f1ca8c commit d1300f5

File tree

2 files changed

+38
-0
lines changed
  • spring-graphql-test/src/main/resources/META-INF/native-image/org.springframework.graphql/spring-graphql
  • spring-graphql/src/main/resources/META-INF/native-image/org.springframework.graphql/spring-graphql

2 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bundles": [],
3+
"resources": {
4+
"includes": [
5+
{
6+
"pattern": "\\Qgraphql-test\/\\E.*\\Q.graphql\\E",
7+
"condition": {
8+
"typeReachable": "org.springframework.graphql.test.tester.GraphQlTester"
9+
}
10+
},
11+
{
12+
"pattern": "\\Qgraphql-test\/\\E.*\\Q.gql\\E",
13+
"condition": {
14+
"typeReachable": "org.springframework.graphql.test.tester.GraphQlTester"
15+
}
16+
}
17+
]
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bundles": [],
3+
"resources": {
4+
"includes": [
5+
{
6+
"pattern": "\\Qgraphql-documents\/\\E.*\\Q.graphql\\E",
7+
"condition": {
8+
"typeReachable": "org.springframework.graphql.client.GraphQlClient"
9+
}
10+
},
11+
{
12+
"pattern": "\\Qgraphql-documents\/\\E.*\\Q.gql\\E",
13+
"condition": {
14+
"typeReachable": "org.springframework.graphql.client.GraphQlClient"
15+
}
16+
}
17+
]
18+
}
19+
}

0 commit comments

Comments
 (0)