Skip to main content

@graphql-tools/graphql-tag-pluck

Functions#

Functions#

gqlPluckFromCodeString#

Const gqlPluckFromCodeString(filePath: string, code: string, options?: GraphQLTagPluckOptions): Promise<string\>

Asynchronously plucks GraphQL template literals from a single file.

Supported file extensions include: .js, .jsx, .ts, .tsx, .flow, .flow.js, .flow.jsx, .vue

Parameters#

NameTypeDefault valueDescription
filePathstring-Path to the file containing the code. Required to detect the file type
codestring-The contents of the file being parsed.
optionsGraphQLTagPluckOptions{}Additional options for determining how a file is parsed.

Returns: Promise<string\>

Defined in: packages/graphql-tag-pluck/src/index.ts:127


gqlPluckFromCodeStringSync#

Const gqlPluckFromCodeStringSync(filePath: string, code: string, options?: GraphQLTagPluckOptions): string

Synchronously plucks GraphQL template literals from a single file

Supported file extensions include: .js, .jsx, .ts, .tsx, .flow, .flow.js, .flow.jsx, .vue

Parameters#

NameTypeDefault valueDescription
filePathstring-Path to the file containing the code. Required to detect the file type
codestring-The contents of the file being parsed.
optionsGraphQLTagPluckOptions{}Additional options for determining how a file is parsed.

Returns: string

Defined in: packages/graphql-tag-pluck/src/index.ts:154


parseCode#

parseCode(__namedParameters: { code: string ; filePath: string ; options: GraphQLTagPluckOptions }): PluckedContent[]

Parameters#

NameType
__namedParametersobject
__namedParameters.codestring
__namedParameters.filePathstring
__namedParameters.optionsGraphQLTagPluckOptions

Returns: PluckedContent[]

Defined in: packages/graphql-tag-pluck/src/index.ts:172