Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init({ api }, next) {
schema.addQueryField({
name: "site",
type: createResponseType(GraphQLDateTime),
args: {
date: { type: GraphQLDateTime }
},
resolve: responseResolver((obj, args) => {
throw Error("Ne svidas mi se")
})
});
schema.getType("SecurityApiTokens") &&
schema.extend("SecurityApiTokens", fields => {
return {
...fields,
invalidate: {
type: GraphQLString,
description: "Added by MyApp to invalidate tokens.",
resolve() {
return "Token has been invalidated!";
}
}
};
});
next();
}
};
fields: () => ({
id: { type: GraphQLID },
createdOn: { type: GraphQLDateTime },
title: { type: GraphQLString },
slug: { type: GraphQLString },
settings: { type: GraphQLJSON },
content: { type: GraphQLJSON },
category: { type: schema.getType(CategoryType.name) },
status: { type: GraphQLString },
activeRevision: { type: schema.getType(RevisionType.name) },
lastRevision: { type: schema.getType(RevisionType.name) },
revisions: { type: new GraphQLList(schema.getType(RevisionType.name)) },
})
});
fields: () => ({
id: { type: GraphQLID },
createdOn: { type: GraphQLDateTime },
name: { type: GraphQLString, description: "Revision name" },
title: { type: GraphQLString, description: "Page title" },
slug: { type: GraphQLString },
settings: { type: GraphQLJSON },
content: { type: GraphQLJSON },
published: { type: GraphQLBoolean},
locked: { type: GraphQLBoolean},
page: { type: schema.getType(PageType.name) }
})
});
fields: () => ({
id: { type: GraphQLID },
createdOn: { type: GraphQLDateTime },
title: { type: GraphQLString },
slug: { type: GraphQLString },
settings: { type: GraphQLJSON },
content: { type: GraphQLJSON },
category: { type: schema.getType(CategoryType.name) },
status: { type: GraphQLString },
activeRevision: { type: schema.getType(RevisionType.name) },
lastRevision: { type: schema.getType(RevisionType.name) },
revisions: { type: new GraphQLList(schema.getType(RevisionType.name)) },
})
});
fields: () => ({
id: { type: GraphQLID },
createdOn: { type: GraphQLDateTime },
title: { type: GraphQLString },
slug: { type: GraphQLString },
settings: { type: GraphQLJSON },
content: { type: GraphQLJSON },
category: { type: schema.getType(CategoryType.name) },
status: { type: GraphQLString },
activeRevision: { type: schema.getType(RevisionType.name) },
lastRevision: { type: schema.getType(RevisionType.name) },
revisions: { type: new GraphQLList(schema.getType(RevisionType.name)) },
})
});