Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- groupsUsers {
- id
- group {
- id
- }
- user {
- id
- name
- email
- password
- type
- }
- }
- }
- {
- "errors": [
- {
- "message": "Field "group" must not have a selection since type "Int!" has no subfields.",
- "locations": [
- {
- "line": 4,
- "column": 11
- }
- ],
- "stack": [
- "Field "group" must not have a selection since type "Int!" has no subfields.",
- "",
- "GraphQL request (4:11)",
- "3: id",
- "4: group {",
- " ^",
- "5: id",
- "",
- " at Object.Field (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\rules\ScalarLeafs.js:50:33)",
- " at Object.enter (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:333:29)",
- " at Object.enter (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:384:25)",
- " at visit (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:251:26)",
- " at validate (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\validate.js:63:22)",
- " at C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\express-graphql\dist\index.js:154:52",
- " at process.internalTickCallback (internal/process/next_tick.js:77:7)"
- ]
- },
- {
- "message": "Field "group" argument "id" of type "Int!" is required but not provided.",
- "locations": [
- {
- "line": 4,
- "column": 5
- }
- ],
- "stack": [
- "Field "group" argument "id" of type "Int!" is required but not provided.",
- "",
- "GraphQL request (4:5)",
- "3: id",
- "4: group {",
- " ^",
- "5: id",
- "",
- " at Object.leave (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\rules\ProvidedRequiredArguments.js:71:35)",
- " at Object.leave (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:354:29)",
- " at Object.leave (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:404:21)",
- " at visit (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:251:26)",
- " at validate (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\validate.js:63:22)",
- " at C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\express-graphql\dist\index.js:154:52",
- " at process.internalTickCallback (internal/process/next_tick.js:77:7)"
- ]
- },
- {
- "message": "Field "user" must not have a selection since type "Int!" has no subfields.",
- "locations": [
- {
- "line": 7,
- "column": 10
- }
- ],
- "stack": [
- "Field "user" must not have a selection since type "Int!" has no subfields.",
- "",
- "GraphQL request (7:10)",
- "6: }",
- "7: user {",
- " ^",
- "8: id",
- "",
- " at Object.Field (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\rules\ScalarLeafs.js:50:33)",
- " at Object.enter (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:333:29)",
- " at Object.enter (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:384:25)",
- " at visit (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:251:26)",
- " at validate (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\validate.js:63:22)",
- " at C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\express-graphql\dist\index.js:154:52",
- " at process.internalTickCallback (internal/process/next_tick.js:77:7)"
- ]
- },
- {
- "message": "Field "user" argument "id" of type "Int!" is required but not provided.",
- "locations": [
- {
- "line": 7,
- "column": 5
- }
- ],
- "stack": [
- "Field "user" argument "id" of type "Int!" is required but not provided.",
- "",
- "GraphQL request (7:5)",
- "6: }",
- "7: user {",
- " ^",
- "8: id",
- "",
- " at Object.leave (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\rules\ProvidedRequiredArguments.js:71:35)",
- " at Object.leave (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:354:29)",
- " at Object.leave (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:404:21)",
- " at visit (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\language\visitor.js:251:26)",
- " at validate (C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\graphql\validation\validate.js:63:22)",
- " at C:\Users\Администратор.WIN-T6JHM2R3APV\Documents\GitHub\vertex-edu-server\node_modules\express-graphql\dist\index.js:154:52",
- " at process.internalTickCallback (internal/process/next_tick.js:77:7)"
- ]
- }
- ]
- }
- const User=new GraphQLObjectType({
- name:'User',
- fields: () => {
- return ({
- id: {type: new GraphQLNonNull(GraphQLInt)},
- name: {type: new GraphQLNonNull(GraphQLString)},
- email: {type: new GraphQLNonNull(GraphQLString)},
- password: {type: new GraphQLNonNull(GraphQLString)},
- type: {type: new GraphQLNonNull(GraphQLString)}
- });
- }
- });
- const Group=new GraphQLObjectType({
- name:'Group',
- fields: () => {
- return ({
- id: {type: new GraphQLNonNull(GraphQLInt)}
- });
- }
- });
- const GroupUser=new GraphQLObjectType({
- name:'GroupUser',
- fields: () => {
- return ({
- id: {type: new GraphQLNonNull(GraphQLInt)},
- group: {
- type: new GraphQLNonNull(GraphQLInt),
- fields: () => {
- return ({
- id: {type: new GraphQLNonNull(GraphQLInt)}
- });
- },
- args: {
- id: {type: new GraphQLNonNull(GraphQLInt)}
- },
- resolve: async function (source, {id}) {
- return (await util.searchSql($sql.groupQueryById, id))[0];
- }
- },
- user: {
- type: new GraphQLNonNull(GraphQLInt),
- fields: () => {
- return ({
- id: {type: new GraphQLNonNull(GraphQLInt)},
- name: {type: new GraphQLNonNull(GraphQLString)},
- email: {type: new GraphQLNonNull(GraphQLString)},
- password: {type: new GraphQLNonNull(GraphQLString)},
- type: {type: new GraphQLNonNull(GraphQLString)}
- });
- },
- args: {
- id: {type: new GraphQLNonNull(GraphQLInt)}
- },
- resolve: async function (source, {id}) {
- return (await util.searchSql($sql.userQueryById, [id]))[0];
- }
- }
- });
- },
- });
- module.exports = {
- query: {
- user: {
- type: new GraphQLList(User),
- args: {
- id: {type: new GraphQLNonNull(GraphQLInt)},
- },
- resolve: async function (source, {id}) {
- return await (util.searchSql($sql.userQueryById, [id]));
- }
- },
- users: {
- type: new GraphQLList(User),
- resolve: async function () {
- return await util.searchSql($sql.userQueryAll);
- }
- },
- group: {
- type: new GraphQLList(Group),
- args: {
- id: {type: new GraphQLNonNull(GraphQLInt)}
- },
- resolve: async function ({id}) {
- return await (util.searchSql($sql.groupQueryById, [id]))[0];
- }
- },
- groups: {
- type: new GraphQLList(Group),
- resolve: async function () {
- return await util.searchSql($sql.groupQueryAll);
- }
- },
- groupUser: {
- type: new GraphQLList(GroupUser),
- args: {
- id: {type: new GraphQLNonNull(GraphQLInt)}
- },
- resolve: async function ({id}) {
- return await (util.searchSql($sql.groupUserQueryById, [id]))[0];
- }
- },
- groupsUsers: {
- type: new GraphQLList(GroupUser),
- resolve: async function () {
- return await util.searchSql($sql.groupUserQueryAll);
- }
- }
- }
- };
Add Comment
Please, Sign In to add comment