Skip to content

Commit

Permalink
docs: Write about excluded and enabledGlobalFragments options
Browse files Browse the repository at this point in the history
  • Loading branch information
Quramy committed Mar 13, 2024
1 parent dda85ad commit 47af79c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -35,6 +35,8 @@ This plugin has the following features:
- [Plugin options](#plugin-options)
- [`schema`](#schema)
- [`tag`](#tag)
- [`exclude`](#exclude)
- [`enabledGlobalFragments`](#enabledglobalfragments)
- [`localSchemaExtensions`](#localschemaextensions)
- [`typegen.addons`](#typegenaddons)
- [`removeDuplicatedFragments`](#removeduplicatedfragments)
Expand Down Expand Up @@ -121,6 +123,7 @@ Pass plugin options to your tsconfig.json to configure this plugin.
/* plugin options */
"schema": "path-or-url-to-your-schema.graphql",
"tag": "gql",
"exclude": ["__generated__"],
...
}
]
Expand Down Expand Up @@ -270,6 +273,22 @@ const str3 = otherTagFn`foooo`; // don't work
It's useful to write multiple kinds template strings(e.g. one is Angular Component template, another is Apollo GraphQL query).
### `exclude`
It's optional. Specify an array of file or directory names when you want to exclude specific TypeScript sources from the plugin's analysis.
It's useful if other code generator copies your GraphQL Template Strings.
> [!NOTE]
> Currently, the `exclude` option only accepts file or directory names. Wildcard characters such as `*` and `**` are not allowed.
### `enabledGlobalFragments`
It's optional and the default value is `false`. If enabled, the plugin automatically searches for and merges the dependent fragments for the target GraphQL operation in the TypeScript project.
> [!IMPORTANT]
> Fragments must be given a unique name if this option is enabled.
### `localSchemaExtensions`
It's optional. If you want to extend server-side schema, derived from `schema` option, you can set path of SDL file of your local extension.
Expand Down

0 comments on commit 47af79c

Please sign in to comment.