@graphql-tools/graphql-tag-pluck
Table of contents
Interfaces
Functions
Functions
gqlPluckFromCodeString
▸ gqlPluckFromCodeString(filePath, code, options?): Promise<Source[]>
Asynchronously plucks GraphQL template literals from a single file.
Supported file extensions include: .js, .jsx, .ts, .tsx, .flow, .flow.js, .flow.jsx, .vue, .svelte
Parameters
| Name | Type | Description |
|---|---|---|
filePath | string | Path to the file containing the code. Required to detect the file type |
code | string | The contents of the file being parsed. |
options | GraphQLTagPluckOptions | Additional options for determining how a file is parsed. |
Returns
Promise<Source[]>
Defined in
packages/graphql-tag-pluck/src/index.ts:140
gqlPluckFromCodeStringSync
▸ gqlPluckFromCodeStringSync(filePath, code, options?): Source[]
Synchronously plucks GraphQL template literals from a single file
Supported file extensions include: .js, .jsx, .ts, .tsx, .flow, .flow.js, .flow.jsx, .vue, .svelte
Parameters
| Name | Type | Description |
|---|---|---|
filePath | string | Path to the file containing the code. Required to detect the file type |
code | string | The contents of the file being parsed. |
options | GraphQLTagPluckOptions | Additional options for determining how a file is parsed. |
Returns
Source[]
Defined in
packages/graphql-tag-pluck/src/index.ts:166
parseCode
▸ parseCode(__namedParameters): PluckedContent[]
Parameters
| Name | Type |
|---|---|
__namedParameters | Object |
__namedParameters.code | string |
__namedParameters.filePath | string |
__namedParameters.options | GraphQLTagPluckOptions |
Returns
PluckedContent[]