get-graphql-from-jsonschema
Version:
get-graphql-from-jsonschema gets a GraphQL schema from a JSON schema.
17 lines (13 loc) • 433 B
text/typescript
import { ScalarType } from './Types/ScalarType';
import { scalarTypes } from './scalarTypes';
const handleScalarType = function ({ type }: {
type: ScalarType;
}): { typeName: string; typeDefinitions: string[] } {
const graphqlTypeName = scalarTypes[type];
const graphqlTypeDefinitions: string[] = [];
return {
typeName: graphqlTypeName,
typeDefinitions: graphqlTypeDefinitions
};
};
export { handleScalarType };