Skip to Content
GraphQL Tools
DocumentationAPI@graphql-tools/graphql-tag-plucksrcfunctionsgqlPluckFromCodeStringSync

Function: gqlPluckFromCodeStringSync()

gqlPluckFromCodeStringSync(filePath, code, options?): Source[]

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

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

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[]