• Docs
  • API Reference
  • Packages
  • graphql-tag-pluck

@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

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: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

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:166


parseCode

parseCode(__namedParameters): PluckedContent[]

Parameters

NameType
__namedParametersObject
__namedParameters.codestring
__namedParameters.filePathstring
__namedParameters.optionsGraphQLTagPluckOptions

Returns

PluckedContent[]

Defined in

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