soap-graphql
Version:
Create a GraphQL schema from a WSDL-defined SOAP endpoint.
65 lines (64 loc) • 2.44 kB
TypeScript
import { GraphQLScalarType, GraphQLOutputType, GraphQLInputType } from 'graphql';
/**
* Resolver that converts WSDL types, that are not fully defined in the WSDL itself, to GraphQL types.
* This is especially necessary for all primitive WSDL types (resp. scalar GraphQL types) like 'string', 'datetime', etc.
*
* You can provide your own resolver to handle custom types of your WSDL.
* But you must still provide resolvment for primitive types like 'string', e.g by re-using DefaultTypeResolver.
*/
export interface CustomTypeResolver {
outputType(typeName: string): GraphQLOutputType;
inputType(typeName: string): GraphQLInputType;
}
/**
* Default implementation of CustomTypeResolver.
* Based on https://www.w3.org/TR/xmlschema-2/#built-in-datatypes
*/
export declare class DefaultTypeResolver implements CustomTypeResolver {
string: GraphQLScalarType;
base64Binary: GraphQLScalarType;
hexBinary: GraphQLScalarType;
duration: GraphQLScalarType;
gYearMonth: GraphQLScalarType;
gYear: GraphQLScalarType;
gMonthDay: GraphQLScalarType;
gDay: GraphQLScalarType;
gMonth: GraphQLScalarType;
anyURI: GraphQLScalarType;
QName: GraphQLScalarType;
normalizedString: GraphQLScalarType;
token: GraphQLScalarType;
NMTOKEN: GraphQLScalarType;
NMTOKENS: GraphQLScalarType;
language: GraphQLScalarType;
Name: GraphQLScalarType;
NCName: GraphQLScalarType;
IDREF: GraphQLScalarType;
IDREFS: GraphQLScalarType;
ENTITY: GraphQLScalarType;
ENTITIES: GraphQLScalarType;
ID: GraphQLScalarType;
boolean: GraphQLScalarType;
byte: GraphQLScalarType;
unsignedByte: GraphQLScalarType;
short: GraphQLScalarType;
unsignedShort: GraphQLScalarType;
int: GraphQLScalarType;
unsignedInt: GraphQLScalarType;
integer: GraphQLScalarType;
positiveInteger: GraphQLScalarType;
nonPositiveInteger: GraphQLScalarType;
negativeInteger: GraphQLScalarType;
nonNegativeInteger: GraphQLScalarType;
long: GraphQLScalarType;
unsignedLong: GraphQLScalarType;
decimal: GraphQLScalarType;
float: GraphQLScalarType;
double: GraphQLScalarType;
dateTime: any;
date: any;
time: any;
resolve(typeName: string): GraphQLScalarType;
outputType(typeName: string): GraphQLOutputType;
inputType(typeName: string): GraphQLInputType;
}