@graphql-tools/graphql-tag-pluck
Interfaces
Functions
Functions
gqlPluckFromCodeString
▸ gqlPluckFromCodeString(filePath, code, options?): Promise<Source[]>
Asynchronously plucks GraphQL template literals from a single file.
Supported file extensions include: .js, .mjs, .cjs, .jsx, .ts, .mts, .cts, .tsx, .flow, .flow.js, .flow.jsx, .vue, .svelte, .astro
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:221
gqlPluckFromCodeStringSync
▸ gqlPluckFromCodeStringSync(filePath, code, options?): Source[]
Synchronously plucks GraphQL template literals from a single file
Supported file extensions include: .js, .mjs, .cjs, .jsx, .ts, .mjs, .cjs, .tsx, .flow, .flow.js, .flow.jsx, .vue, .svelte, .astro, .gts, .gjs
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:262
parseCode
▸ parseCode(«destructured»): PluckedContent[]
Parameters
| Name | Type | 
|---|---|
| «destructured» | Object | 
| › code | string | 
| › filePath | string | 
| › options | GraphQLTagPluckOptions | 
Returns
PluckedContent[]