MCPcopy
hub / github.com/prettier/prettier / isEmbedGraphQL

Function isEmbedGraphQL

src/language-js/embed/graphql.js:107–121  ·  view source on GitHub ↗
({ node, parent })

Source from the content-addressed store, hash-verified

105 * support Relay Classic formatting.
106 */
107function isEmbedGraphQL({ node, parent }) {
108 return (
109 hasLanguageComment({ node, parent }, "GraphQL") ||
110 (parent &&
111 ((parent.type === "TaggedTemplateExpression" &&
112 ((parent.tag.type === "MemberExpression" &&
113 parent.tag.object.name === "graphql" &&
114 parent.tag.property.name === "experimental") ||
115 (parent.tag.type === "Identifier" &&
116 (parent.tag.name === "gql" || parent.tag.name === "graphql")))) ||
117 (parent.type === "CallExpression" &&
118 parent.callee.type === "Identifier" &&
119 parent.callee.name === "graphql")))
120 );
121}
122
123export { isEmbedGraphQL, printEmbedGraphQL };

Callers

nothing calls this directly

Calls 1

hasLanguageCommentFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…