mirror of
https://github.com/strapi/strapi.git
synced 2025-10-17 02:53:22 +00:00
Support dynamic zones in graphql
This commit is contained in:
parent
05cfd05c10
commit
db08e93cc7
@ -11,15 +11,15 @@
|
||||
"test": "echo \"no tests yet\""
|
||||
},
|
||||
"dependencies": {
|
||||
"apollo-server-koa": "^2.9.0",
|
||||
"apollo-server-koa": "2.9.12",
|
||||
"dataloader": "^1.4.0",
|
||||
"glob": "^7.1.4",
|
||||
"graphql": "^14.3.0",
|
||||
"graphql-depth-limit": "^1.1.0",
|
||||
"graphql-playground-middleware-koa": "^1.6.0",
|
||||
"graphql-tools": "^4.0.4",
|
||||
"graphql-tools": "4.0.6",
|
||||
"graphql-type-datetime": "^0.2.4",
|
||||
"graphql-type-json": "^0.3.0",
|
||||
"graphql-type-json": "0.3.1",
|
||||
"graphql-type-long": "^0.1.1",
|
||||
"koa-compose": "^4.1.0",
|
||||
"pluralize": "^7.0.0",
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
const _ = require('lodash');
|
||||
const graphql = require('graphql');
|
||||
|
||||
const Aggregator = require('./Aggregator');
|
||||
const Query = require('./Query.js');
|
||||
@ -42,6 +43,119 @@ const generateEnumDefinitions = (attributes, globalId) => {
|
||||
.join('');
|
||||
};
|
||||
|
||||
const generateDynamicZoneDefinitions = (attributes, globalId, schema) => {
|
||||
Object.keys(attributes)
|
||||
.filter(attribute => attributes[attribute].type === 'dynamiczone')
|
||||
.forEach(attribute => {
|
||||
const { components } = attributes[attribute];
|
||||
|
||||
const typeName = `${globalId}${_.upperFirst(
|
||||
_.camelCase(attribute)
|
||||
)}DynamicZone`;
|
||||
|
||||
if (components.length === 0) {
|
||||
// Create dummy type because graphql doesn't support empty ones
|
||||
// TODO: do sth
|
||||
}
|
||||
|
||||
const componentsTypeNames = components.map(componentUID => {
|
||||
const compo = strapi.components[componentUID];
|
||||
if (!compo) {
|
||||
throw new Error(
|
||||
`Trying to creating dynamiczone type with unkown component ${componentUID}`
|
||||
);
|
||||
}
|
||||
|
||||
return compo.globalId;
|
||||
});
|
||||
|
||||
const unionType = `union ${typeName} = ${componentsTypeNames.join(
|
||||
' | '
|
||||
)}`;
|
||||
|
||||
const inputTypeName = `${typeName}Input`;
|
||||
|
||||
schema.definition += `\n${unionType}\nscalar ${inputTypeName}\n`;
|
||||
|
||||
schema.resolvers[typeName] = {
|
||||
__resolveType(obj) {
|
||||
return strapi.components[obj.__component].globalId;
|
||||
},
|
||||
};
|
||||
|
||||
function parseObject(ast, variables) {
|
||||
const value = Object.create(null);
|
||||
ast.fields.forEach(field => {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
value[field.name.value] = parseLiteral(field.value, variables);
|
||||
});
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
function parseLiteral(ast, variables) {
|
||||
switch (ast.kind) {
|
||||
case graphql.Kind.STRING:
|
||||
case graphql.Kind.BOOLEAN:
|
||||
return ast.value;
|
||||
case graphql.Kind.INT:
|
||||
case graphql.Kind.FLOAT:
|
||||
return parseFloat(ast.value);
|
||||
case graphql.Kind.OBJECT:
|
||||
return parseObject(ast, variables);
|
||||
case graphql.Kind.LIST:
|
||||
return ast.values.map(n => parseLiteral(n, variables));
|
||||
case graphql.Kind.NULL:
|
||||
return null;
|
||||
case graphql.Kind.VARIABLE: {
|
||||
const name = ast.name.value;
|
||||
return variables ? variables[name] : undefined;
|
||||
}
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
schema.resolvers[inputTypeName] = new graphql.GraphQLScalarType({
|
||||
name: inputTypeName,
|
||||
description: `Input type for dynamic zone ${attribute} of ${globalId}`,
|
||||
serialize: value => value,
|
||||
parseValue: value => {
|
||||
const compo = Object.values(strapi.components).find(
|
||||
compo => compo.globalId === value.__typename
|
||||
);
|
||||
|
||||
if (!compo) return undefined;
|
||||
|
||||
const finalValue = {
|
||||
__component: compo.uid,
|
||||
..._.omit(value, ['__typename']),
|
||||
};
|
||||
|
||||
return finalValue;
|
||||
},
|
||||
parseLiteral: (ast, variables) => {
|
||||
if (ast.kind !== graphql.Kind.OBJECT) return undefined;
|
||||
|
||||
const value = parseObject(ast, variables);
|
||||
|
||||
const compo = Object.values(strapi.components).find(
|
||||
compo => compo.globalId === value.__typename
|
||||
);
|
||||
|
||||
if (!compo) return undefined;
|
||||
|
||||
const finalValue = {
|
||||
__component: compo.uid,
|
||||
..._.omit(value, ['__typename']),
|
||||
};
|
||||
|
||||
return finalValue;
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const mutateAssocAttributes = (associations = [], attributes) => {
|
||||
associations
|
||||
.filter(association => association.type === 'collection')
|
||||
@ -61,158 +175,175 @@ const buildAssocResolvers = (model, name, { plugin }) => {
|
||||
const { primaryKey, associations = [] } = model;
|
||||
|
||||
return associations
|
||||
.filter(association => model.attributes[association.alias].private !== true)
|
||||
.reduce((resolver, association) => {
|
||||
switch (association.nature) {
|
||||
case 'oneToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
const entry = await contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[association.alias]
|
||||
);
|
||||
|
||||
// Set the _type only when the value is defined
|
||||
if (entry[association.alias]) {
|
||||
entry[association.alias]._type = _.upperFirst(association.model);
|
||||
}
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 'manyMorphToOne':
|
||||
case 'manyMorphToMany':
|
||||
case 'manyToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
// eslint-disable-line no-unused-vars
|
||||
const [withRelated, withoutRelated] = await Promise.all([
|
||||
contentManager.fetch(
|
||||
.filter(association => model.attributes[association.alias].private !== true)
|
||||
.reduce((resolver, association) => {
|
||||
switch (association.nature) {
|
||||
case 'oneToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
const entry = await contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[association.alias],
|
||||
false
|
||||
),
|
||||
contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[]
|
||||
),
|
||||
]);
|
||||
|
||||
const entry =
|
||||
withRelated && withRelated.toJSON
|
||||
? withRelated.toJSON()
|
||||
: withRelated;
|
||||
|
||||
entry[association.alias].map((entry, index) => {
|
||||
const type =
|
||||
_.get(withoutRelated, `${association.alias}.${index}.kind`) ||
|
||||
_.upperFirst(
|
||||
_.camelCase(
|
||||
_.get(
|
||||
withoutRelated,
|
||||
`${association.alias}.${index}.${association.alias}_type`
|
||||
)
|
||||
)
|
||||
) ||
|
||||
_.upperFirst(_.camelCase(association[association.type]));
|
||||
|
||||
entry._type = type;
|
||||
|
||||
return entry;
|
||||
});
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
resolver[association.alias] = async (obj, options) => {
|
||||
// Construct parameters object to retrieve the correct related entries.
|
||||
const params = {
|
||||
model: association.model || association.collection,
|
||||
};
|
||||
|
||||
let queryOpts = {
|
||||
source: association.plugin,
|
||||
};
|
||||
|
||||
// Get refering model.
|
||||
const ref = association.plugin
|
||||
? strapi.plugins[association.plugin].models[params.model]
|
||||
: strapi.models[params.model];
|
||||
|
||||
if (association.type === 'model') {
|
||||
params[ref.primaryKey] = _.get(
|
||||
obj,
|
||||
[association.alias, ref.primaryKey],
|
||||
obj[association.alias]
|
||||
[association.alias]
|
||||
);
|
||||
} else {
|
||||
const queryParams = Query.amountLimiting(options);
|
||||
queryOpts = {
|
||||
...queryOpts,
|
||||
...Query.convertToParams(_.omit(queryParams, 'where')), // Convert filters (sort, limit and start/skip)
|
||||
...Query.convertToQuery(queryParams.where),
|
||||
|
||||
// Set the _type only when the value is defined
|
||||
if (entry[association.alias]) {
|
||||
entry[association.alias]._type = _.upperFirst(association.model);
|
||||
}
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 'manyMorphToOne':
|
||||
case 'manyMorphToMany':
|
||||
case 'manyToManyMorph': {
|
||||
resolver[association.alias] = async obj => {
|
||||
// eslint-disable-line no-unused-vars
|
||||
const [withRelated, withoutRelated] = await Promise.all([
|
||||
contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[association.alias],
|
||||
false
|
||||
),
|
||||
contentManager.fetch(
|
||||
{
|
||||
id: obj[primaryKey],
|
||||
model: name,
|
||||
},
|
||||
plugin,
|
||||
[]
|
||||
),
|
||||
]);
|
||||
|
||||
const entry =
|
||||
withRelated && withRelated.toJSON
|
||||
? withRelated.toJSON()
|
||||
: withRelated;
|
||||
|
||||
entry[association.alias].map((entry, index) => {
|
||||
const type =
|
||||
_.get(withoutRelated, `${association.alias}.${index}.kind`) ||
|
||||
_.upperFirst(
|
||||
_.camelCase(
|
||||
_.get(
|
||||
withoutRelated,
|
||||
`${association.alias}.${index}.${association.alias}_type`
|
||||
)
|
||||
)
|
||||
) ||
|
||||
_.upperFirst(_.camelCase(association[association.type]));
|
||||
|
||||
entry._type = type;
|
||||
|
||||
return entry;
|
||||
});
|
||||
|
||||
return entry[association.alias];
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
resolver[association.alias] = async (obj, options) => {
|
||||
// Construct parameters object to retrieve the correct related entries.
|
||||
const params = {
|
||||
model: association.model || association.collection,
|
||||
};
|
||||
|
||||
if (
|
||||
((association.nature === 'manyToMany' && association.dominant) ||
|
||||
association.nature === 'manyWay') &&
|
||||
_.has(obj, association.alias) // if populated
|
||||
) {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', ref.primaryKey],
|
||||
let queryOpts = {
|
||||
source: association.plugin,
|
||||
};
|
||||
|
||||
// Get refering model.
|
||||
const ref = association.plugin
|
||||
? strapi.plugins[association.plugin].models[params.model]
|
||||
: strapi.models[params.model];
|
||||
|
||||
if (association.type === 'model') {
|
||||
params[ref.primaryKey] = _.get(
|
||||
obj,
|
||||
[association.alias, ref.primaryKey],
|
||||
obj[association.alias]
|
||||
? obj[association.alias]
|
||||
.map(val => val[ref.primaryKey] || val)
|
||||
.sort()
|
||||
: []
|
||||
);
|
||||
} else {
|
||||
_.set(queryOpts, ['query', association.via], obj[ref.primaryKey]);
|
||||
const queryParams = Query.amountLimiting(options);
|
||||
queryOpts = {
|
||||
...queryOpts,
|
||||
...Query.convertToParams(_.omit(queryParams, 'where')), // Convert filters (sort, limit and start/skip)
|
||||
...Query.convertToQuery(queryParams.where),
|
||||
};
|
||||
|
||||
if (
|
||||
((association.nature === 'manyToMany' &&
|
||||
association.dominant) ||
|
||||
association.nature === 'manyWay') &&
|
||||
_.has(obj, association.alias) // if populated
|
||||
) {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', ref.primaryKey],
|
||||
obj[association.alias]
|
||||
? obj[association.alias]
|
||||
.map(val => val[ref.primaryKey] || val)
|
||||
.sort()
|
||||
: []
|
||||
);
|
||||
} else {
|
||||
_.set(
|
||||
queryOpts,
|
||||
['query', association.via],
|
||||
obj[ref.primaryKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const loaderName = association.plugin
|
||||
? `${association.plugin}__${params.model}`
|
||||
: params.model;
|
||||
const loaderName = association.plugin
|
||||
? `${association.plugin}__${params.model}`
|
||||
: params.model;
|
||||
|
||||
return association.model
|
||||
? strapi.plugins.graphql.services.loaders.loaders[loaderName].load({
|
||||
params,
|
||||
options: queryOpts,
|
||||
single: true,
|
||||
})
|
||||
: strapi.plugins.graphql.services.loaders.loaders[loaderName].load({
|
||||
options: queryOpts,
|
||||
association,
|
||||
});
|
||||
};
|
||||
break;
|
||||
return association.model
|
||||
? strapi.plugins.graphql.services.loaders.loaders[
|
||||
loaderName
|
||||
].load({
|
||||
params,
|
||||
options: queryOpts,
|
||||
single: true,
|
||||
})
|
||||
: strapi.plugins.graphql.services.loaders.loaders[
|
||||
loaderName
|
||||
].load({
|
||||
options: queryOpts,
|
||||
association,
|
||||
});
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resolver;
|
||||
}, {});
|
||||
return resolver;
|
||||
}, {});
|
||||
};
|
||||
|
||||
const buildModel = (model, name, { plugin, isComponent = false } = {}) => {
|
||||
const buildModel = (
|
||||
model,
|
||||
name,
|
||||
{ schema, plugin, isComponent = false } = {}
|
||||
) => {
|
||||
const { globalId, primaryKey } = model;
|
||||
|
||||
let definition = '';
|
||||
schema.resolvers[globalId] = {
|
||||
id: obj => obj[primaryKey],
|
||||
...buildAssocResolvers(model, name, { plugin }),
|
||||
};
|
||||
|
||||
const initialState = {
|
||||
id: 'ID!',
|
||||
[primaryKey]: 'ID!',
|
||||
@ -228,28 +359,17 @@ const buildModel = (model, name, { plugin, isComponent = false } = {}) => {
|
||||
mutateAssocAttributes(model.associations, attributes);
|
||||
_.merge(attributes, initialState);
|
||||
|
||||
definition += generateEnumDefinitions(model.attributes, globalId);
|
||||
schema.definition += generateEnumDefinitions(model.attributes, globalId);
|
||||
generateDynamicZoneDefinitions(model.attributes, globalId, schema);
|
||||
|
||||
const description = Schema.getDescription({}, model);
|
||||
const fields = Schema.formatGQL(attributes, {}, model);
|
||||
const typeDef = `${description}type ${globalId} {${fields}}\n`;
|
||||
|
||||
definition += typeDef;
|
||||
definition += Types.generateInputModel(model, globalId, {
|
||||
schema.definition += typeDef;
|
||||
schema.definition += Types.generateInputModel(model, globalId, {
|
||||
allowIds: isComponent,
|
||||
});
|
||||
|
||||
const resolver = {
|
||||
[globalId]: {
|
||||
id: obj => obj[primaryKey],
|
||||
...buildAssocResolvers(model, name, { plugin }),
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
definition,
|
||||
resolver,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
@ -263,7 +383,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
definition: '',
|
||||
query: {},
|
||||
mutation: {},
|
||||
resolver: { Query: {}, Mutation: {} },
|
||||
resolvers: { Query: {}, Mutation: {} },
|
||||
};
|
||||
|
||||
if (_.isEmpty(models)) {
|
||||
@ -286,7 +406,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
initialState['id'] = 'ID!';
|
||||
}
|
||||
|
||||
acc.resolver[globalId] = {
|
||||
acc.resolvers[globalId] = {
|
||||
// define the default id resolver
|
||||
id(parent) {
|
||||
return parent[model.primaryKey];
|
||||
@ -312,6 +432,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
_.merge(attributes, initialState);
|
||||
|
||||
acc.definition += generateEnumDefinitions(model.attributes, globalId);
|
||||
generateDynamicZoneDefinitions(model.attributes, globalId, acc);
|
||||
|
||||
const description = Schema.getDescription(type[globalId], model);
|
||||
const fields = Schema.formatGQL(attributes, type[globalId], model);
|
||||
@ -365,7 +486,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
query: {
|
||||
[`${singularName}(id: ID!)`]: model.globalId,
|
||||
},
|
||||
resolver: {
|
||||
resolvers: {
|
||||
Query: {
|
||||
[singularName]: queries.singular,
|
||||
},
|
||||
@ -378,7 +499,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
query: {
|
||||
[`${pluralName}(sort: String, limit: Int, start: Int, where: JSON)`]: `[${model.globalId}]`,
|
||||
},
|
||||
resolver: {
|
||||
resolvers: {
|
||||
Query: {
|
||||
[pluralName]: queries.plural,
|
||||
},
|
||||
@ -460,7 +581,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
// Assign mutation definition to global definition.
|
||||
_.merge(acc, {
|
||||
mutation: mutationDefinition,
|
||||
resolver: {
|
||||
resolvers: {
|
||||
Mutation: {
|
||||
[`${mutationName}`]: mutations[type],
|
||||
},
|
||||
@ -469,8 +590,7 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
}
|
||||
});
|
||||
|
||||
// TODO:
|
||||
// - Add support for Graphql Aggregation in Bookshelf ORM
|
||||
// TODO: Add support for Graphql Aggregation in Bookshelf ORM
|
||||
if (model.orm === 'mongoose') {
|
||||
// Generation the aggregation for the given model
|
||||
const modelAggregator = Aggregator.formatModelConnectionsGQL(
|
||||
@ -481,19 +601,17 @@ const buildShadowCRUD = (models, plugin) => {
|
||||
);
|
||||
if (modelAggregator) {
|
||||
acc.definition += modelAggregator.type;
|
||||
if (!acc.resolver[modelAggregator.globalId]) {
|
||||
acc.resolver[modelAggregator.globalId] = {};
|
||||
if (!acc.resolvers[modelAggregator.globalId]) {
|
||||
acc.resolvers[modelAggregator.globalId] = {};
|
||||
}
|
||||
|
||||
_.merge(acc.resolver, modelAggregator.resolver);
|
||||
_.merge(acc.resolvers, modelAggregator.resolver);
|
||||
_.merge(acc.query, modelAggregator.query);
|
||||
}
|
||||
}
|
||||
|
||||
// Build associations queries.
|
||||
_.merge(acc.resolver, {
|
||||
[globalId]: buildAssocResolvers(model, name, { plugin }),
|
||||
});
|
||||
acc.resolvers[globalId] = buildAssocResolvers(model, name, { plugin });
|
||||
|
||||
return acc;
|
||||
}, initialState);
|
||||
|
@ -130,7 +130,7 @@ const schemaBuilder = {
|
||||
|
||||
generateSchema: function() {
|
||||
// Generate type definition and query/mutation for models.
|
||||
let shadowCRUD = { definition: '', query: '', mutation: '', resolver: '' };
|
||||
let shadowCRUD = { definition: '', query: '', mutation: '', resolvers: {} };
|
||||
|
||||
// build defaults schemas if shadowCRUD is enabled
|
||||
if (strapi.plugins.graphql.config.shadowCRUD !== false) {
|
||||
@ -157,22 +157,18 @@ const schemaBuilder = {
|
||||
}, modelCruds);
|
||||
}
|
||||
|
||||
let components = Object.keys(strapi.components)
|
||||
.map(key =>
|
||||
Resolvers.buildModel(strapi.components[key], key, {
|
||||
plugin: null,
|
||||
isComponent: true,
|
||||
})
|
||||
)
|
||||
.reduce(
|
||||
(acc, component) => {
|
||||
return {
|
||||
definition: acc.definition + component.definition,
|
||||
resolver: _.merge(acc.resolver, component.resolver),
|
||||
};
|
||||
},
|
||||
{ definition: '', resolver: {} }
|
||||
);
|
||||
const componentsSchema = {
|
||||
definition: '',
|
||||
resolvers: {},
|
||||
};
|
||||
|
||||
Object.keys(strapi.components).forEach(key =>
|
||||
Resolvers.buildModel(strapi.components[key], key, {
|
||||
plugin: null,
|
||||
isComponent: true,
|
||||
schema: componentsSchema,
|
||||
})
|
||||
);
|
||||
|
||||
// Extract custom definition, query or resolver.
|
||||
const {
|
||||
@ -192,8 +188,8 @@ const schemaBuilder = {
|
||||
const resolvers =
|
||||
_.omitBy(
|
||||
_.merge(
|
||||
shadowCRUD.resolver,
|
||||
components.resolver,
|
||||
shadowCRUD.resolvers,
|
||||
componentsSchema.resolvers,
|
||||
resolver,
|
||||
polymorphicResolver
|
||||
),
|
||||
@ -202,6 +198,10 @@ const schemaBuilder = {
|
||||
|
||||
// Transform object to only contain function.
|
||||
Object.keys(resolvers).reduce((acc, type) => {
|
||||
if (graphql.isScalarType(acc[type])) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
return Object.keys(acc[type]).reduce((acc, resolverName) => {
|
||||
const resolverObj = acc[type][resolverName];
|
||||
// Disabled this query.
|
||||
@ -251,7 +251,7 @@ const schemaBuilder = {
|
||||
break;
|
||||
}
|
||||
case 'Query':
|
||||
default:
|
||||
default: {
|
||||
acc[type][resolverName] = Query.composeQueryResolver({
|
||||
_schema: strapi.plugins.graphql.config._schema.graphql,
|
||||
plugin,
|
||||
@ -259,6 +259,7 @@ const schemaBuilder = {
|
||||
isSingular: 'force', // Avoid singular/pluralize and force query name.
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return acc;
|
||||
@ -274,7 +275,7 @@ const schemaBuilder = {
|
||||
let typeDefs = `
|
||||
${definition}
|
||||
${shadowCRUD.definition}
|
||||
${components.definition}
|
||||
${componentsSchema.definition}
|
||||
type Query {${shadowCRUD.query &&
|
||||
this.formatGQL(
|
||||
shadowCRUD.query,
|
||||
|
@ -9,14 +9,12 @@
|
||||
const _ = require('lodash');
|
||||
const { GraphQLUpload } = require('apollo-server-koa');
|
||||
const graphql = require('graphql');
|
||||
const GraphQLJSON = require('graphql-type-json');
|
||||
const { GraphQLJSON } = require('graphql-type-json');
|
||||
const GraphQLDateTime = require('graphql-type-datetime');
|
||||
const GraphQLLong = require('graphql-type-long');
|
||||
|
||||
const { toSingular } = require('./naming');
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Convert Strapi type to GraphQL type.
|
||||
@ -35,7 +33,11 @@ module.exports = {
|
||||
action = '',
|
||||
}) {
|
||||
// Type
|
||||
if (definition.type && definition.type !== 'component') {
|
||||
if (
|
||||
definition.type &&
|
||||
definition.type !== 'component' &&
|
||||
definition.type !== 'dynamiczone'
|
||||
) {
|
||||
let type = 'String';
|
||||
|
||||
switch (definition.type) {
|
||||
@ -97,6 +99,22 @@ module.exports = {
|
||||
return `${typeName}`;
|
||||
}
|
||||
|
||||
if (definition.type === 'dynamiczone') {
|
||||
const { required } = definition;
|
||||
|
||||
const unionName = `${modelName}${_.upperFirst(
|
||||
_.camelCase(attributeName)
|
||||
)}DynamicZone`;
|
||||
|
||||
let typeName = unionName;
|
||||
|
||||
if (rootType === 'mutation') {
|
||||
typeName = `${unionName}Input!`;
|
||||
}
|
||||
|
||||
return `[${typeName}]${required ? '!' : ''}`;
|
||||
}
|
||||
|
||||
const ref = definition.model || definition.collection;
|
||||
|
||||
// Association
|
||||
@ -192,7 +210,7 @@ module.exports = {
|
||||
polymorphicDef: `union Morph = ${types.join(' | ')}`,
|
||||
polymorphicResolver: {
|
||||
Morph: {
|
||||
__resolveType(obj, context, info) {
|
||||
__resolveType(obj) {
|
||||
// eslint-disable-line no-unused-vars
|
||||
return obj.kind || obj._type;
|
||||
},
|
||||
|
291
yarn.lock
291
yarn.lock
@ -2,6 +2,25 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@apollo/protobufjs@^1.0.3":
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@apollo/protobufjs/-/protobufjs-1.0.3.tgz#02c655aedd4ba7c7f64cbc3d2b1dd9a000a391ba"
|
||||
integrity sha512-gqeT810Ect9WIqsrgfUvr+ljSB5m1PyBae9HGdrRyQ3HjHjTcjVvxpsMYXlUk4rUHnrfUqyoGvLSy2yLlRGEOw==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.2"
|
||||
"@protobufjs/base64" "^1.1.2"
|
||||
"@protobufjs/codegen" "^2.0.4"
|
||||
"@protobufjs/eventemitter" "^1.1.0"
|
||||
"@protobufjs/fetch" "^1.1.0"
|
||||
"@protobufjs/float" "^1.0.2"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
"@protobufjs/path" "^1.1.2"
|
||||
"@protobufjs/pool" "^1.1.0"
|
||||
"@protobufjs/utf8" "^1.1.0"
|
||||
"@types/long" "^4.0.0"
|
||||
"@types/node" "^10.1.0"
|
||||
long "^4.0.0"
|
||||
|
||||
"@apollographql/apollo-tools@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.4.0.tgz#8a1a0ab7a0bb12ccc03b72e4a104cfa5d969fd5f"
|
||||
@ -3215,13 +3234,13 @@ anymatch@~3.1.1:
|
||||
normalize-path "^3.0.0"
|
||||
picomatch "^2.0.4"
|
||||
|
||||
apollo-cache-control@^0.8.5:
|
||||
version "0.8.5"
|
||||
resolved "https://registry.yarnpkg.com/apollo-cache-control/-/apollo-cache-control-0.8.5.tgz#d4b34691f6ca1cefac9d82b99a94a0815a85a5a8"
|
||||
integrity sha512-2yQ1vKgJQ54SGkoQS/ZLZrDX3La6cluAYYdruFYJMJtL4zQrSdeOCy11CQliCMYEd6eKNyE70Rpln51QswW2Og==
|
||||
apollo-cache-control@^0.8.8:
|
||||
version "0.8.8"
|
||||
resolved "https://registry.yarnpkg.com/apollo-cache-control/-/apollo-cache-control-0.8.8.tgz#c6de9ef3a154560f6cf26ce7159e62438c1ac022"
|
||||
integrity sha512-hpIJg3Tmb6quA111lrVO+d3qcyYRlJ8JqbeQdcgwLT3fb2VQzk21SrBZYl2oMM4ZqSOWCZWg4/Cn9ARYqdWjKA==
|
||||
dependencies:
|
||||
apollo-server-env "^2.4.3"
|
||||
graphql-extensions "^0.10.4"
|
||||
graphql-extensions "^0.10.7"
|
||||
|
||||
apollo-datasource@^0.6.3:
|
||||
version "0.6.3"
|
||||
@ -3231,25 +3250,25 @@ apollo-datasource@^0.6.3:
|
||||
apollo-server-caching "^0.5.0"
|
||||
apollo-server-env "^2.4.3"
|
||||
|
||||
apollo-engine-reporting-protobuf@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.4.1.tgz#c0a35bcf28487f87dcbc452b03277f575192f5d2"
|
||||
integrity sha512-d7vFFZ2oUrvGaN0Hpet8joe2ZG0X0lIGilN+SwgVP38dJnOuadjsaYMyrD9JudGQJg0bJA5wVQfYzcCVy0slrw==
|
||||
apollo-engine-reporting-protobuf@^0.4.4:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.4.4.tgz#73a064f8c9f2d6605192d1673729c66ec47d9cb7"
|
||||
integrity sha512-SGrIkUR7Q/VjU8YG98xcvo340C4DaNUhg/TXOtGsMlfiJDzHwVau/Bv6zifAzBafp2lj0XND6Daj5kyT/eSI/w==
|
||||
dependencies:
|
||||
protobufjs "^6.8.6"
|
||||
"@apollo/protobufjs" "^1.0.3"
|
||||
|
||||
apollo-engine-reporting@^1.4.7:
|
||||
version "1.4.7"
|
||||
resolved "https://registry.yarnpkg.com/apollo-engine-reporting/-/apollo-engine-reporting-1.4.7.tgz#6ca69ebdc1c17200969e2e4e07a0be64d748c27e"
|
||||
integrity sha512-qsKDz9VkoctFhojM3Nj3nvRBO98t8TS2uTgtiIjUGs3Hln2poKMP6fIQ37Nm2Q2B3JJst76HQtpPwXmRJd1ZUg==
|
||||
apollo-engine-reporting@^1.4.10:
|
||||
version "1.4.10"
|
||||
resolved "https://registry.yarnpkg.com/apollo-engine-reporting/-/apollo-engine-reporting-1.4.10.tgz#cca245133906ed4ece125e48cb95dd959f3af2f6"
|
||||
integrity sha512-0nEawO9cudbXHCxRvnDUWKqCxPAGEstghUFd5sB67lIGuh91MYeLuwN1iTfqUdwF1feEGHn636zVVUYlXGOlvQ==
|
||||
dependencies:
|
||||
apollo-engine-reporting-protobuf "^0.4.1"
|
||||
apollo-engine-reporting-protobuf "^0.4.4"
|
||||
apollo-graphql "^0.3.4"
|
||||
apollo-server-caching "^0.5.0"
|
||||
apollo-server-env "^2.4.3"
|
||||
apollo-server-types "^0.2.5"
|
||||
apollo-server-types "^0.2.8"
|
||||
async-retry "^1.2.1"
|
||||
graphql-extensions "^0.10.4"
|
||||
graphql-extensions "^0.10.7"
|
||||
|
||||
apollo-env@0.5.1, apollo-env@^0.5.1:
|
||||
version "0.5.1"
|
||||
@ -3285,26 +3304,26 @@ apollo-server-caching@^0.5.0:
|
||||
dependencies:
|
||||
lru-cache "^5.0.0"
|
||||
|
||||
apollo-server-core@^2.9.6:
|
||||
version "2.9.6"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.9.6.tgz#b6dc087200633f47ca4f08244d3e606b4d616320"
|
||||
integrity sha512-2tHAWQxP7HrETI/BZvg2fem6YlahF9HUp4Y6SSL95WP3uNMOJBlN12yM1y+O2u5K5e4jwdPNaLjoL2A/26XrLw==
|
||||
apollo-server-core@^2.9.12:
|
||||
version "2.9.12"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.9.12.tgz#c8ed48540762913242eef5fce0da8b59b131a1e8"
|
||||
integrity sha512-jhGr2R655PSwUUBweXDl+0F3oa74Elu5xXF+88ymUUej34EwBUCqz97wPqR07BEuyxaAlRfZwPMvKaHhMUKg5g==
|
||||
dependencies:
|
||||
"@apollographql/apollo-tools" "^0.4.0"
|
||||
"@apollographql/graphql-playground-html" "1.6.24"
|
||||
"@types/graphql-upload" "^8.0.0"
|
||||
"@types/ws" "^6.0.0"
|
||||
apollo-cache-control "^0.8.5"
|
||||
apollo-cache-control "^0.8.8"
|
||||
apollo-datasource "^0.6.3"
|
||||
apollo-engine-reporting "^1.4.7"
|
||||
apollo-engine-reporting "^1.4.10"
|
||||
apollo-server-caching "^0.5.0"
|
||||
apollo-server-env "^2.4.3"
|
||||
apollo-server-errors "^2.3.3"
|
||||
apollo-server-plugin-base "^0.6.5"
|
||||
apollo-server-types "^0.2.5"
|
||||
apollo-tracing "^0.8.5"
|
||||
apollo-server-errors "^2.3.4"
|
||||
apollo-server-plugin-base "^0.6.8"
|
||||
apollo-server-types "^0.2.8"
|
||||
apollo-tracing "^0.8.8"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
graphql-extensions "^0.10.4"
|
||||
graphql-extensions "^0.10.7"
|
||||
graphql-tag "^2.9.2"
|
||||
graphql-tools "^4.0.0"
|
||||
graphql-upload "^8.0.2"
|
||||
@ -3320,15 +3339,15 @@ apollo-server-env@^2.4.3:
|
||||
node-fetch "^2.1.2"
|
||||
util.promisify "^1.0.0"
|
||||
|
||||
apollo-server-errors@^2.3.3:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.3.3.tgz#83763b00352c10dc68fbb0d41744ade66de549ff"
|
||||
integrity sha512-MO4oJ129vuCcbqwr5ZwgxqGGiLz3hCyowz0bstUF7MR+vNGe4oe3DWajC9lv4CxrhcqUHQOeOPViOdIo1IxE3g==
|
||||
apollo-server-errors@^2.3.4:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.3.4.tgz#b70ef01322f616cbcd876f3e0168a1a86b82db34"
|
||||
integrity sha512-Y0PKQvkrb2Kd18d1NPlHdSqmlr8TgqJ7JQcNIfhNDgdb45CnqZlxL1abuIRhr8tiw8OhVOcFxz2KyglBi8TKdA==
|
||||
|
||||
apollo-server-koa@^2.9.0:
|
||||
version "2.9.6"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-koa/-/apollo-server-koa-2.9.6.tgz#5ef8589d5f4fcc95096d3bbc490f42e7829622ab"
|
||||
integrity sha512-KctnBETMJ6Obt1sYhxwIi7XAi/pDz2ifOV5sktc6Gx9Jt5JNL9SmQGFFNCXaWbTyCcPKckQhXfumcHgbAWAXoA==
|
||||
apollo-server-koa@2.9.12:
|
||||
version "2.9.12"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-koa/-/apollo-server-koa-2.9.12.tgz#07d59355295d66f869bd981b55e9fdea0d0e0e6f"
|
||||
integrity sha512-LPICtgDhiJPJkxWcaVE1ReAGM1ajKlU1EZru7oIUjrO8S/helkvdUKTDy6Bu+GSYP6PwiHo68mI2kChecPZJkg==
|
||||
dependencies:
|
||||
"@apollographql/graphql-playground-html" "1.6.24"
|
||||
"@koa/cors" "^2.2.1"
|
||||
@ -3339,39 +3358,39 @@ apollo-server-koa@^2.9.0:
|
||||
"@types/koa-compose" "^3.2.2"
|
||||
"@types/koa__cors" "^2.2.1"
|
||||
accepts "^1.3.5"
|
||||
apollo-server-core "^2.9.6"
|
||||
apollo-server-types "^0.2.5"
|
||||
apollo-server-core "^2.9.12"
|
||||
apollo-server-types "^0.2.8"
|
||||
graphql-subscriptions "^1.0.0"
|
||||
graphql-tools "^4.0.0"
|
||||
koa "2.8.2"
|
||||
koa "2.11.0"
|
||||
koa-bodyparser "^4.2.1"
|
||||
koa-compose "^4.1.0"
|
||||
koa-router "^7.4.0"
|
||||
type-is "^1.6.16"
|
||||
|
||||
apollo-server-plugin-base@^0.6.5:
|
||||
version "0.6.5"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.6.5.tgz#eebe27734c51bf6a45b6a9ec8738750b132ffde7"
|
||||
integrity sha512-z2ve7HEPWmZI3EzL0iiY9qyt1i0hitT+afN5PzssCw594LB6DfUQWsI14UW+W+gcw8hvl8VQUpXByfUntAx5vw==
|
||||
apollo-server-plugin-base@^0.6.8:
|
||||
version "0.6.8"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.6.8.tgz#94cb9a6d806b7057d1d42202292d2adcf2cf0e7a"
|
||||
integrity sha512-0pKCjcg9gHBK8qlb280+N0jl99meixQtxXnMJFyIfD+45OpKQ+WolHIbO0oZgNEt7r/lNWwH8v3l5yYm1ghz1A==
|
||||
dependencies:
|
||||
apollo-server-types "^0.2.5"
|
||||
apollo-server-types "^0.2.8"
|
||||
|
||||
apollo-server-types@^0.2.5:
|
||||
version "0.2.5"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-0.2.5.tgz#2d63924706ffc1a59480cbbc93e9fe86655a57a5"
|
||||
integrity sha512-6iJQsPh59FWu4K7ABrVmpnQVgeK8Ockx8BcawBh+saFYWTlVczwcLyGSZPeV1tPSKwFwKZutyEslrYSafcarXQ==
|
||||
apollo-server-types@^0.2.8:
|
||||
version "0.2.8"
|
||||
resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-0.2.8.tgz#729208a8dd72831af3aa4f1eb584022ada146e6b"
|
||||
integrity sha512-5OclxkAqjhuO75tTNHpSO/+doJZ+VlRtTefnrPJdK/uwVew9U/VUCWkYdryZWwEyVe1nvQ/4E7RYR4tGb8l8wA==
|
||||
dependencies:
|
||||
apollo-engine-reporting-protobuf "^0.4.1"
|
||||
apollo-engine-reporting-protobuf "^0.4.4"
|
||||
apollo-server-caching "^0.5.0"
|
||||
apollo-server-env "^2.4.3"
|
||||
|
||||
apollo-tracing@^0.8.5:
|
||||
version "0.8.5"
|
||||
resolved "https://registry.yarnpkg.com/apollo-tracing/-/apollo-tracing-0.8.5.tgz#f07c4584d95bcf750e44bfe9845e073b03774941"
|
||||
integrity sha512-lZn10/GRBZUlMxVYLghLMFsGcLN0jTYDd98qZfBtxw+wEWUx+PKkZdljDT+XNoOm/kDvEutFGmi5tSLhArIzWQ==
|
||||
apollo-tracing@^0.8.8:
|
||||
version "0.8.8"
|
||||
resolved "https://registry.yarnpkg.com/apollo-tracing/-/apollo-tracing-0.8.8.tgz#bfaffd76dc12ed5cc1c1198b5411864affdb1b83"
|
||||
integrity sha512-aIwT2PsH7VZZPaNrIoSjzLKMlG644d2Uf+GYcoMd3X6UEyg1sXdWqkKfCeoS6ChJKH2khO7MXAvOZC03UnCumQ==
|
||||
dependencies:
|
||||
apollo-server-env "^2.4.3"
|
||||
graphql-extensions "^0.10.4"
|
||||
graphql-extensions "^0.10.7"
|
||||
|
||||
apollo-utilities@^1.0.1, apollo-utilities@^1.3.0:
|
||||
version "1.3.2"
|
||||
@ -4014,11 +4033,6 @@ bluebird@^3.1.1, bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.0.tgz#56a6a886e03f6ae577cffedeb524f8f2450293cf"
|
||||
integrity sha512-aBQ1FxIa7kSWCcmKHlcHFlT2jt6J/l4FzC7KcPELkOJOsPOb/bccdhmIrKDfXhwFrmc7vDoDrrepFvGqjyXGJg==
|
||||
|
||||
bluebird@^3.7.0:
|
||||
version "3.7.1"
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de"
|
||||
integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==
|
||||
|
||||
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
|
||||
version "4.11.8"
|
||||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
|
||||
@ -4931,11 +4945,6 @@ colorette@1.0.7:
|
||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.0.7.tgz#7adf43c445ee63a541b4a4aef7d13f03df1e0cc0"
|
||||
integrity sha512-KeK4klsvAgdODAjFPm6QLzvStizJqlxMBtVo4KQMCgk5tt/tf9rAzxmxLHNRynJg3tJjkKGKbHx3j4HLox27Lw==
|
||||
|
||||
colorette@1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.1.0.tgz#1f943e5a357fac10b4e0f5aaef3b14cdc1af6ec7"
|
||||
integrity sha512-6S062WDQUXi6hOfkO/sBPVwE5ASXY4G2+b4atvhJfSsuUUhIaUKlkjLe9692Ipyt5/a+IPF5aVTu3V5gvXq5cg==
|
||||
|
||||
colors@^1.1.2, colors@^1.3.3:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
|
||||
@ -4986,11 +4995,6 @@ commander@^2.11.0, commander@^2.19.0, commander@^2.20.0, commander@^2.8.1:
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
||||
|
||||
commander@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e"
|
||||
integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==
|
||||
|
||||
commander@~2.19.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
|
||||
@ -5304,6 +5308,14 @@ cookies@~0.7.1:
|
||||
depd "~1.1.2"
|
||||
keygrip "~1.0.3"
|
||||
|
||||
cookies@~0.8.0:
|
||||
version "0.8.0"
|
||||
resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90"
|
||||
integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==
|
||||
dependencies:
|
||||
depd "~2.0.0"
|
||||
keygrip "~1.1.0"
|
||||
|
||||
copy-concurrently@^1.0.0:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0"
|
||||
@ -6159,6 +6171,11 @@ depd@^1.1.2, depd@~1.1.2:
|
||||
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
|
||||
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
|
||||
|
||||
depd@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
|
||||
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
|
||||
|
||||
deprecated-decorator@^0.1.6:
|
||||
version "0.1.6"
|
||||
resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37"
|
||||
@ -8061,11 +8078,6 @@ getopts@2.2.3:
|
||||
resolved "https://registry.yarnpkg.com/getopts/-/getopts-2.2.3.tgz#11d229775e2ec2067ed8be6fcc39d9b4bf39cf7d"
|
||||
integrity sha512-viEcb8TpgeG05+Nqo5EzZ8QR0hxdyrYDp6ZSTZqe2M/h53Bk036NmqG38Vhf5RGirC/Of9Xql+v66B2gp256SQ==
|
||||
|
||||
getopts@2.2.5:
|
||||
version "2.2.5"
|
||||
resolved "https://registry.yarnpkg.com/getopts/-/getopts-2.2.5.tgz#67a0fe471cacb9c687d817cab6450b96dde8313b"
|
||||
integrity sha512-9jb7AW5p3in+IiJWhQiZmmwkpLaR/ccTWdWQCtZM66HJcHHLegowh4q4tSD7gouUyeNvFWRavfK9GXosQHDpFA==
|
||||
|
||||
getos@3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/getos/-/getos-3.1.0.tgz#db3aa4df15a3295557ce5e81aa9e3e5cdfaa6567"
|
||||
@ -8427,14 +8439,14 @@ graphql-depth-limit@^1.1.0:
|
||||
dependencies:
|
||||
arrify "^1.0.1"
|
||||
|
||||
graphql-extensions@^0.10.4:
|
||||
version "0.10.4"
|
||||
resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.10.4.tgz#af851b0d44ea6838cf54de9df3cfc6a8e575e571"
|
||||
integrity sha512-lE6MroluEYocbR/ICwccv39w+Pz4cBPadJ11z1rJkbZv5wstISEganbDOwl9qN21rcZGiWzh7QUNxUiFUXXEDw==
|
||||
graphql-extensions@^0.10.7:
|
||||
version "0.10.7"
|
||||
resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.10.7.tgz#ca9f8ec3cb0af1739b48ca42280ec9162ad116d1"
|
||||
integrity sha512-YuP7VQxNePG4bWRQ5Vk+KRMbZ9r1IWCqCCogOMz/1ueeQ4gZe93eGRcb0vhpOdMFnCX6Vyvd4+sC+N6LR3YFOQ==
|
||||
dependencies:
|
||||
"@apollographql/apollo-tools" "^0.4.0"
|
||||
apollo-server-env "^2.4.3"
|
||||
apollo-server-types "^0.2.5"
|
||||
apollo-server-types "^0.2.8"
|
||||
|
||||
graphql-playground-html@1.6.13:
|
||||
version "1.6.13"
|
||||
@ -8460,7 +8472,18 @@ graphql-tag@^2.9.2:
|
||||
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.1.tgz#10aa41f1cd8fae5373eaf11f1f67260a3cad5e02"
|
||||
integrity sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg==
|
||||
|
||||
graphql-tools@^4.0.0, graphql-tools@^4.0.4:
|
||||
graphql-tools@4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.6.tgz#0e729e73db05ade3df10a2f92511be544972a844"
|
||||
integrity sha512-jHLQw8x3xmSNRBCsaZqelXXsFfUSUSktSCUP8KYHiX1Z9qEuwcMpAf+FkdBzk8aTAFqOlPdNZ3OI4DKKqGKUqg==
|
||||
dependencies:
|
||||
apollo-link "^1.2.3"
|
||||
apollo-utilities "^1.0.1"
|
||||
deprecated-decorator "^0.1.6"
|
||||
iterall "^1.1.3"
|
||||
uuid "^3.1.0"
|
||||
|
||||
graphql-tools@^4.0.0:
|
||||
version "4.0.5"
|
||||
resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.5.tgz#d2b41ee0a330bfef833e5cdae7e1f0b0d86b1754"
|
||||
integrity sha512-kQCh3IZsMqquDx7zfIGWBau42xe46gmqabwYkpPlCLIjcEY1XK+auP7iGRD9/205BPyoQdY8hT96MPpgERdC9Q==
|
||||
@ -8478,10 +8501,10 @@ graphql-type-datetime@^0.2.4:
|
||||
dependencies:
|
||||
moment "^2.22.2"
|
||||
|
||||
graphql-type-json@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/graphql-type-json/-/graphql-type-json-0.3.0.tgz#bb32e1b74bf52ebc690f9df12b4067bc061f818a"
|
||||
integrity sha512-lnxg5HiB95yxy+/5cDKtP6pZo0zgntsOmqsjeCBXFGJ4YoMF3+1YaSEKWJntNTu+VsAm3zf6lPxFpp1kxzofLA==
|
||||
graphql-type-json@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/graphql-type-json/-/graphql-type-json-0.3.1.tgz#47fca2b1fa7adc0758d165b33580d7be7a6cf548"
|
||||
integrity sha512-1lPkUXQ2L8o+ERLzVAuc3rzc/E6pGF+6HnjihCVTK0VzR0jCuUd92FqNxoHdfILXqOn2L6b4y47TBxiPyieUVA==
|
||||
|
||||
graphql-type-long@^0.1.1:
|
||||
version "0.1.1"
|
||||
@ -9262,7 +9285,7 @@ inflight@^1.0.4:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4:
|
||||
inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
@ -10692,6 +10715,13 @@ keygrip@~1.0.3:
|
||||
resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.0.3.tgz#399d709f0aed2bab0a059e0cdd3a5023a053e1dc"
|
||||
integrity sha512-/PpesirAIfaklxUzp4Yb7xBper9MwP6hNRA6BGGUFCgbJ+BM5CKBtsoxinNXkLHAr+GXS1/lSlF2rP7cv5Fl+g==
|
||||
|
||||
keygrip@~1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226"
|
||||
integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==
|
||||
dependencies:
|
||||
tsscmp "1.0.6"
|
||||
|
||||
keyv@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373"
|
||||
@ -10763,27 +10793,6 @@ knex@^0.16.5:
|
||||
uuid "^3.3.2"
|
||||
v8flags "^3.1.2"
|
||||
|
||||
knex@^0.19.0:
|
||||
version "0.19.5"
|
||||
resolved "https://registry.yarnpkg.com/knex/-/knex-0.19.5.tgz#3597ebecf88a5942f18c3e6d91af53bda59eeb5d"
|
||||
integrity sha512-Hy258avCVircQq+oj3WBqPzl8jDIte438Qlq+8pt1i/TyLYVA4zPh2uKc7Bx0t+qOpa6D42HJ2jjtl2vagzilw==
|
||||
dependencies:
|
||||
bluebird "^3.7.0"
|
||||
colorette "1.1.0"
|
||||
commander "^3.0.2"
|
||||
debug "4.1.1"
|
||||
getopts "2.2.5"
|
||||
inherits "~2.0.4"
|
||||
interpret "^1.2.0"
|
||||
liftoff "3.1.0"
|
||||
lodash "^4.17.15"
|
||||
mkdirp "^0.5.1"
|
||||
pg-connection-string "2.1.0"
|
||||
tarn "^2.0.0"
|
||||
tildify "2.0.0"
|
||||
uuid "^3.3.3"
|
||||
v8flags "^3.1.3"
|
||||
|
||||
koa-body@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/koa-body/-/koa-body-4.1.1.tgz#50686d290891fc6f1acb986cf7cfcd605f855ef0"
|
||||
@ -10956,7 +10965,37 @@ koa2-ratelimit@^0.9.0:
|
||||
promise-redis "0.0.5"
|
||||
sequelize "^5.8.7"
|
||||
|
||||
koa@2.8.2, koa@^2.8.0:
|
||||
koa@2.11.0:
|
||||
version "2.11.0"
|
||||
resolved "https://registry.yarnpkg.com/koa/-/koa-2.11.0.tgz#fe5a51c46f566d27632dd5dc8fd5d7dd44f935a4"
|
||||
integrity sha512-EpR9dElBTDlaDgyhDMiLkXrPwp6ZqgAIBvhhmxQ9XN4TFgW+gEz6tkcsNI6BnUbUftrKDjVFj4lW2/J2aNBMMA==
|
||||
dependencies:
|
||||
accepts "^1.3.5"
|
||||
cache-content-type "^1.0.0"
|
||||
content-disposition "~0.5.2"
|
||||
content-type "^1.0.4"
|
||||
cookies "~0.8.0"
|
||||
debug "~3.1.0"
|
||||
delegates "^1.0.0"
|
||||
depd "^1.1.2"
|
||||
destroy "^1.0.4"
|
||||
encodeurl "^1.0.2"
|
||||
error-inject "^1.0.0"
|
||||
escape-html "^1.0.3"
|
||||
fresh "~0.5.2"
|
||||
http-assert "^1.3.0"
|
||||
http-errors "^1.6.3"
|
||||
is-generator-function "^1.0.7"
|
||||
koa-compose "^4.1.0"
|
||||
koa-convert "^1.2.0"
|
||||
on-finished "^2.3.0"
|
||||
only "~0.0.2"
|
||||
parseurl "^1.3.2"
|
||||
statuses "^1.5.0"
|
||||
type-is "^1.6.16"
|
||||
vary "^1.1.2"
|
||||
|
||||
koa@^2.8.0:
|
||||
version "2.8.2"
|
||||
resolved "https://registry.yarnpkg.com/koa/-/koa-2.8.2.tgz#dfba771a69c1a98e014826804e95132c00af6615"
|
||||
integrity sha512-q1uZOgpl3wjr5FS/tjbABJ8lA5+NeKa9eq7QyBP5xxgOBwJN4iBrMEgO3LroE51lrIw3BsO0WZZ0Yi6giSiMDw==
|
||||
@ -13559,11 +13598,6 @@ pg-connection-string@2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.0.0.tgz#3eefe5997e06d94821e4d502e42b6a1c73f8df82"
|
||||
integrity sha1-Pu/lmX4G2Ugh5NUC5CtqHHP434I=
|
||||
|
||||
pg-connection-string@2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.1.0.tgz#e07258f280476540b24818ebb5dca29e101ca502"
|
||||
integrity sha512-bhlV7Eq09JrRIvo1eKngpwuqKtJnNhZdpdOlvrPrA4dxqXPjxSrbNrfnIDmTpwMyRszrcV4kU5ZA4mMsQUrjdg==
|
||||
|
||||
pg-int8@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c"
|
||||
@ -14364,25 +14398,6 @@ proto-list@~1.2.1:
|
||||
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
|
||||
integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=
|
||||
|
||||
protobufjs@^6.8.6:
|
||||
version "6.8.8"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c"
|
||||
integrity sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.2"
|
||||
"@protobufjs/base64" "^1.1.2"
|
||||
"@protobufjs/codegen" "^2.0.4"
|
||||
"@protobufjs/eventemitter" "^1.1.0"
|
||||
"@protobufjs/fetch" "^1.1.0"
|
||||
"@protobufjs/float" "^1.0.2"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
"@protobufjs/path" "^1.1.2"
|
||||
"@protobufjs/pool" "^1.1.0"
|
||||
"@protobufjs/utf8" "^1.1.0"
|
||||
"@types/long" "^4.0.0"
|
||||
"@types/node" "^10.1.0"
|
||||
long "^4.0.0"
|
||||
|
||||
protocols@^1.1.0, protocols@^1.4.0:
|
||||
version "1.4.7"
|
||||
resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.7.tgz#95f788a4f0e979b291ffefcf5636ad113d037d32"
|
||||
@ -17413,11 +17428,6 @@ tarn@^1.1.5:
|
||||
resolved "https://registry.yarnpkg.com/tarn/-/tarn-1.1.5.tgz#7be88622e951738b9fa3fb77477309242cdddc2d"
|
||||
integrity sha512-PMtJ3HCLAZeedWjJPgGnCvcphbCOMbtZpjKgLq3qM5Qq9aQud+XHrL0WlrlgnTyS8U+jrjGbEXprFcQrxPy52g==
|
||||
|
||||
tarn@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/tarn/-/tarn-2.0.0.tgz#c68499f69881f99ae955b4317ca7d212d942fdee"
|
||||
integrity sha512-7rNMCZd3s9bhQh47ksAQd92ADFcJUjjbyOvyFjNLwTPpGieFHMC84S+LOzw0fx1uh6hnDz/19r8CPMnIjJlMMA==
|
||||
|
||||
teeny-request@^3.11.3:
|
||||
version "3.11.3"
|
||||
resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-3.11.3.tgz#335c629f7645e5d6599362df2f3230c4cbc23a55"
|
||||
@ -17585,11 +17595,6 @@ tildify@1.2.0:
|
||||
dependencies:
|
||||
os-homedir "^1.0.0"
|
||||
|
||||
tildify@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/tildify/-/tildify-2.0.0.tgz#f205f3674d677ce698b7067a99e949ce03b4754a"
|
||||
integrity sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==
|
||||
|
||||
timed-out@^4.0.0, timed-out@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"
|
||||
@ -17808,7 +17813,7 @@ tslib@^1, tslib@^1.10.0, tslib@^1.9.0, tslib@^1.9.3:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
|
||||
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
|
||||
|
||||
tsscmp@^1.0.6:
|
||||
tsscmp@1.0.6, tsscmp@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
|
||||
integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==
|
||||
@ -18187,7 +18192,7 @@ v8-compile-cache@^2.0.3:
|
||||
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e"
|
||||
integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==
|
||||
|
||||
v8flags@^3.1.2, v8flags@^3.1.3:
|
||||
v8flags@^3.1.2:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8"
|
||||
integrity sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==
|
||||
|
Loading…
x
Reference in New Issue
Block a user