mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user