MCPcopy Index your code
hub / github.com/StarpTech/FastGraph / getClientSchema

Function getClientSchema

src/graphql-utils.ts:141–160  ·  view source on GitHub ↗
(
  introspectionUrl: string,
  headers: Headers,
)

Source from the content-addressed store, hash-verified

139}
140
141export async function getClientSchema(
142 introspectionUrl: string,
143 headers: Headers,
144) {
145 headers.set(HTTPHeaders.contentType, 'application/json')
146 const resp = await fetch(introspectionUrl, {
147 body: JSON.stringify({
148 operationName: 'IntrospectionQuery',
149 query: introspectionQuery,
150 }),
151 headers,
152 method: 'POST',
153 })
154 const { data } = await resp.json()
155 if (data && !data.errors) {
156 return buildClientSchema(data)
157 }
158
159 return null
160}
161
162// https://github.com/graphql/graphql-js/blob/dd0297302800347a20a192624ba6373ee86836a3/src/utilities/introspectionQuery.js#L14
163export const introspectionQuery = `

Callers 1

fetchSchemaFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected