Documentation
API Reference
Packages
graphql-tag-pluck

@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

NameTypeDescription
filePathstringPath to the file containing the code. Required to detect the file type
codestringThe contents of the file being parsed.
optionsGraphQLTagPluckOptionsAdditional options for determining how a file is parsed.

Returns

Promise<Source[]>

Defined in

packages/graphql-tag-pluck/src/index.ts:187


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

Parameters

NameTypeDescription
filePathstringPath to the file containing the code. Required to detect the file type
codestringThe contents of the file being parsed.
optionsGraphQLTagPluckOptionsAdditional options for determining how a file is parsed.

Returns

Source[]

Defined in

packages/graphql-tag-pluck/src/index.ts:217


parseCode

parseCode(«destructured»): PluckedContent[]

Parameters

NameType
«destructured»Object
› codestring
› filePathstring
› optionsGraphQLTagPluckOptions

Returns

PluckedContent[]

Defined in

packages/graphql-tag-pluck/src/index.ts:238