GraphQLJSFrontend
CLASS
GraphQLJSFrontend
1public final class GraphQLJSFrontendMethods
init()
1public init() throwsloadSchema(from:)
1public func loadSchema(from sources: [GraphQLSource]) throws -> GraphQLSchemaLoad a schema by parsing an introspection result.
printSchemaAsSDL(schema:)
1public func printSchemaAsSDL(schema: GraphQLSchema) throws -> StringTake a loaded GQL schema and print it as SDL.
makeSource(_:filePath:)
1public func makeSource(_ body: String, filePath: String) throws -> GraphQLSourceCreate a GraphQLSource object from a string.
makeSource(from:)
1public func makeSource(from fileURL: URL) throws -> GraphQLSourceCreate a GraphQLSource object by reading from a file.
parseDocument(_:experimentalClientControlledNullability:)
1public func parseDocument(
2 _ source: GraphQLSource,
3 experimentalClientControlledNullability: Bool = false
4) throws -> GraphQLDocumentParses a GraphQL document from a source, returning a reference to the parsed AST that can be passed on to validation and compilation.
Syntax errors will result in throwing a GraphQLError.
parseDocument(from:experimentalClientControlledNullability:)
1public func parseDocument(
2 from fileURL: URL,
3 experimentalClientControlledNullability: Bool = false
4) throws -> GraphQLDocumentParses a GraphQL document from a file, returning a reference to the parsed AST that can be passed on to validation and compilation.
Syntax errors will result in throwing a GraphQLError.
mergeDocuments(_:)
1public func mergeDocuments(_ documents: [GraphQLDocument]) throws -> GraphQLDocumentValidation and compilation take a single document, but you can merge documents, and operations and fragments will remember their source.
validateDocument(schema:document:)
1public func validateDocument(schema: GraphQLSchema, document: GraphQLDocument) throws -> [GraphQLError]Validate a GraphQL document and return any validation errors as GraphQLErrors.
compile(schema:document:experimentalLegacySafelistingCompatibleOperations:)
1public func compile(
2 schema: GraphQLSchema,
3 document: GraphQLDocument,
4 experimentalLegacySafelistingCompatibleOperations: Bool = false
5) throws -> CompilationResultCompiles a GraphQL document into an intermediate representation that is more suitable for analysis and code generation.