react-cms
Version:
For personal use. Not production.
58 lines (49 loc) • 1.25 kB
JavaScript
import {
// buildSchema,
// introspectionQuery,
// graphql,
// GraphQLSchema,
GraphQLObjectType,
GraphQLInputObjectType,
GraphQLInt,
GraphQLFloat,
GraphQLString,
GraphQLBoolean,
// GraphQLList,
GraphQLNonNull,
// GraphQLID,
GraphQLEnumType,
} from 'graphql';
import {
DirectiveLocation,
GraphQLDirective,
} from 'graphql/type/directives';
export const ReactCmsStorageStoreType = new GraphQLEnumType({
name: "ReactCmsStorageStoreType",
description: "Указатель источника данных",
values: {
local: {
value: "local",
description: "Локальное хранилище",
},
remote: {
value: "remote",
description: "Удаленное хранилище",
},
},
});
export const storageDirective = new GraphQLDirective({
name: 'storage',
description: 'Указывает откуда данные должны быть получены (локально или удаленно)',
locations: [
DirectiveLocation.SCHEMA,
DirectiveLocation.QUERY,
DirectiveLocation.FIELD,
],
args: {
store: {
type: ReactCmsStorageStoreType,
description: 'Используемое хранилище',
},
},
});