Use [String] for CSV type in GraphQL (#6808)

Fixes #6653
This commit is contained in:
Rijk van Zanten
2021-07-15 02:34:40 +02:00
committed by GitHub
parent 83e056c029
commit be60fa9f31

View File

@@ -1,9 +1,19 @@
import { GraphQLBoolean, GraphQLFloat, GraphQLInt, GraphQLScalarType, GraphQLString } from 'graphql';
import {
GraphQLBoolean,
GraphQLFloat,
GraphQLInt,
GraphQLScalarType,
GraphQLString,
GraphQLList,
GraphQLType,
} from 'graphql';
import { GraphQLJSON } from 'graphql-compose';
import { GraphQLDate } from '../services/graphql';
import { types } from '../types';
export function getGraphQLType(localType: typeof types[number] | 'alias' | 'unknown'): GraphQLScalarType {
export function getGraphQLType(
localType: typeof types[number] | 'alias' | 'unknown'
): GraphQLScalarType | GraphQLList<GraphQLType> {
switch (localType) {
case 'boolean':
return GraphQLBoolean;
@@ -14,6 +24,7 @@ export function getGraphQLType(localType: typeof types[number] | 'alias' | 'unkn
case 'float':
return GraphQLFloat;
case 'csv':
return new GraphQLList(GraphQLString);
case 'json':
return GraphQLJSON;
case 'timestamp':