Skip to content

Commit b7ba73f

Browse files
joffrey-bionJoffrey Bion
andauthored
Add missing documentation for graphqlSchemas block in plugins (#50)
Resolves: #49 Co-authored-by: Joffrey Bion <[email protected]>
1 parent 4c5dbe4 commit b7ba73f

File tree

2 files changed

+22
-2
lines changed
  • plugins

2 files changed

+22
-2
lines changed

plugins/graphql-java-codegen-gradle-plugin/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ check.dependsOn(graphqlCodegen)
9494

9595
| Key | Data Type | Default value | Description |
9696
| ------------------------------------ | ------------------ | ----------------------------------------- | ----------- |
97-
| graphqlSchemaPaths | List(String) | None | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. |
97+
| graphqlSchemaPaths | List(String) | (falls back to `graphqlSchemas`) | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. To include many schemas from a folder hierarchy, use the `graphqlSchemas` block instead. |
98+
| graphqlSchemas | (see table below) | All `.graphqls` files in resources | Block to define the input GraphQL schemas, when exact paths are too cumbersome. See table below for a list of options. |
9899
| packageName | String | Empty | Java package for generated classes. |
99100
| outputDir | String | None | The output target directory into which code will be generated. |
100101
| apiPackage | String | Empty | Java package for generated api classes (Query, Mutation, Subscription). |
@@ -113,6 +114,15 @@ check.dependsOn(graphqlCodegen)
113114
| fieldsWithResolvers | Set(String) | Empty | Fields that require Resolvers should be defined here in format: `TypeName.fieldName`. |
114115
| jsonConfigurationFile | String | Empty | Path to an external mapping configuration. |
115116

117+
When exact paths to GraphQL schemas are too cumbersome to provide in the `graphqlSchemaPaths`, use the `graphqlSchemas { ... }` block.
118+
The parameters inside that block are the following:
119+
120+
| Key | Data Type | Default value | Description |
121+
| ----------------- | ------------ | ------------------ | ----------- |
122+
| `rootDir` | String | Main resources dir | The root directory from which to start searching for schema files. |
123+
| `recursive` | Boolean | `true` | Whether to recursively look into sub directories. |
124+
| `includePattern` | String | `.*\.graphqls` | A Java regex that file names must match to be included. It should be a regex as defined by the [Pattern](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html) JDK class. It will be used to match only the file name without path. |
125+
| `excludedFiles` | Set<String> | (empty set) | A set of files to exclude, even if they match the include pattern. These paths should be either absolute or relative to the provided `rootDir`. |
116126

117127
#### External mapping configuration
118128

plugins/graphql-java-codegen-maven-plugin/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ This Maven plugin is able to generate the following classes based on your GraphQ
5656

5757
| Key | Data Type | Default value | Description |
5858
| ------------------------------------ | ------------------ | ----------------------------------------- | ----------- |
59-
| graphqlSchemaPaths | List(String) | None | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. |
59+
| graphqlSchemaPaths | List(String) | (falls back to `graphqlSchemas`) | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. To include many schemas from a folder hierarchy, use the `graphqlSchemas` block instead. |
60+
| graphqlSchemas | (see table below) | All `.graphqls` files in resources | Block to define the input GraphQL schemas, when exact paths are too cumbersome. See table below for a list of options. |
6061
| packageName | String | Empty | Java package for generated classes. |
6162
| outputDir | String | None | The output target directory into which code will be generated. |
6263
| apiPackage | String | Empty | Java package for generated api classes (Query, Mutation, Subscription). |
@@ -75,6 +76,15 @@ This Maven plugin is able to generate the following classes based on your GraphQ
7576
| fieldsWithResolvers | Set(String) | Empty | Fields that require Resolvers should be defined here in format: `TypeName.fieldName`. |
7677
| jsonConfigurationFile | String | Empty | Path to an external mapping configuration. |
7778

79+
When exact paths to GraphQL schemas are too cumbersome to provide in the `graphqlSchemaPaths`, use the `graphqlSchemas` block.
80+
The parameters inside that block are the following:
81+
82+
| Key | Data Type | Default value | Description |
83+
| ----------------- | ------------ | ------------------ | ----------- |
84+
| `rootDir` | String | Main resources dir | The root directory from which to start searching for schema files. |
85+
| `recursive` | Boolean | `true` | Whether to recursively look into sub directories. |
86+
| `includePattern` | String | `.*\.graphqls` | A Java regex that file names must match to be included. It should be a regex as defined by the [Pattern](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html) JDK class. It will be used to match only the file name without path. |
87+
| `excludedFiles` | Set<String> | (empty set) | A set of files to exclude, even if they match the include pattern. These paths should be either absolute or relative to the provided `rootDir`. |
7888

7989
#### External mapping configuration
8090

0 commit comments

Comments
 (0)