graphql#GraphQLInt JavaScript Examples

The following examples show how to use graphql#GraphQLInt. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: types.js    From crate with MIT License 6 votes vote down vote up
ProductType = new GraphQLObjectType({
  name: 'product',
  description: 'Product Type',

  fields: () => ({
    id: { type: GraphQLInt },
    name: { type: GraphQLString },
    slug: { type: GraphQLString },
    type: { type: GraphQLInt },
    gender: { type: GraphQLInt },
    description: { type: GraphQLString },
    image: { type: GraphQLString },
    createdAt: { type: GraphQLString },
    updatedAt: { type: GraphQLString }
  })
})
Example #2
Source File: types.js    From crate with MIT License 6 votes vote down vote up
UserGenderType = new GraphQLObjectType({
  name: "userGender",
  description: "User Gender Type",

  fields: () => ({
    id: { type: GraphQLInt },
    name: { type: GraphQLString },
  }),
})
Example #3
Source File: types.js    From crate with MIT License 6 votes vote down vote up
UserType = new GraphQLObjectType({
  name: "user",
  description: "User type",

  fields: () => ({
    id: { type: GraphQLInt },
    name: { type: GraphQLString },
    email: { type: GraphQLString },
    address: { type: GraphQLString },
    password: { type: GraphQLString },
    role: { type: GraphQLString },
    createdAt: { type: GraphQLString },
    updatedAt: { type: GraphQLString },
  }),
})
Example #4
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
userUpdate = {
  type: UserType,
  args: {
    id: {
      name: "id",
      type: GraphQLInt,
    },
    name: {
      name: "name",
      type: GraphQLString,
    },
    address: {
      name: "address",
      type: GraphQLString,
    },
  },
  resolve: update,
}
Example #5
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
userRemove = {
  type: UserType,
  args: {
    id: {
      name: "id",
      type: GraphQLInt,
    },
  },
  resolve: remove,
}
Example #6
Source File: types.js    From crate with MIT License 6 votes vote down vote up
SubscriptionType = new GraphQLObjectType({
  name: 'subscription',
  description: 'Subscription Type',

  fields: () => ({
    id: { type: GraphQLInt },
    user: { type: UserType },
    crate: { type: CrateType },
    createdAt: { type: GraphQLString },
    updatedAt: { type: GraphQLString }
  })
})
Example #7
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
subscriptionRemove = {
  type: SubscriptionType,
  args: {
    id: {
      name: 'id',
      type: GraphQLInt
    }
  },
  resolve: remove
}
Example #8
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
subscriptionCreate = {
  type: SubscriptionType,
  args: {
    crateId: {
      name: 'crateId',
      type: GraphQLInt
    }
  },
  resolve: create
}
Example #9
Source File: types.js    From crate with MIT License 6 votes vote down vote up
ProductTypesType = new GraphQLObjectType({
  name: 'productTypesType',
  description: 'User Types Type',

  fields: () => ({
    id: { type: GraphQLInt },
    name: { type: GraphQLString }
  })
})
Example #10
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
productRemove = {
  type: ProductType,
  args: {
    id: {
      name: 'id',
      type: GraphQLInt
    }
  },
  resolve: remove
}
Example #11
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
productCreate = {
  type: ProductType,
  args: {
    name: {
      name: 'name',
      type: GraphQLString
    },

    slug: {
      name: 'slug',
      type: GraphQLString
    },

    description: {
      name: 'description',
      type: GraphQLString
    },

    type: {
      name: 'type',
      type: GraphQLInt
    },

    gender: {
      name: 'gender',
      type: GraphQLInt
    },

    image: {
      name: 'image',
      type: GraphQLString
    }
  },
  resolve: create
}
Example #12
Source File: types.js    From crate with MIT License 6 votes vote down vote up
CrateType = new GraphQLObjectType({
  name: 'crate',
  description: 'Crate Type',

  fields: () => ({
    id: { type: GraphQLInt },
    name: { type: GraphQLString },
    description: { type: GraphQLString },
    createdAt: { type: GraphQLString },
    updatedAt: { type: GraphQLString }
  })
})
Example #13
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
crateRemove = {
  type: CrateType,
  args: {
    id: {
      name: 'id',
      type: GraphQLInt
    }
  },
  resolve: remove
}
Example #14
Source File: mutations.js    From crate with MIT License 6 votes vote down vote up
crateUpdate = {
  type: CrateType,
  args: {
    id: {
      name: 'id',
      type: GraphQLInt
    },

    name: {
      name: 'name',
      type: GraphQLString
    },

    description: {
      name: 'description',
      type: GraphQLString
    }
  },
  resolve: update
}
Example #15
Source File: query.js    From crate with MIT License 5 votes vote down vote up
productsRelated = {
  type: new GraphQLList(ProductType),
  args: {
    productId: { type: GraphQLInt }
  },
  resolve: getRelated
}
Example #16
Source File: 107-test.js    From cybsec with GNU Affero General Public License v3.0 5 votes vote down vote up
remoteSchema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: 'Query',
    fields: {
      users: {
        type: new GraphQLList(new GraphQLObjectType({
          name: 'User',
          fields: {
            name: {
              type: GraphQLString
            },
            age: {
              type: GraphQLInt
            },
            access: {
              type: new GraphQLObjectType({
                name: 'Access',
                fields: {
                  msg: {
                    type: GraphQLString
                  }
                }
              }),
              resolve: source => ({
                msg: source.age >= 20 ? `allowed` : 'disallowed'
              })
            }
          }
        })),
        resolve: () => [{
          name: 'u1',
          age: 10
        }, {
          name: 'u2',
          age: 20
        }, {
          name: 'u3',
          age: 30
        }]
      }
    }
  })
})
Example #17
Source File: query.js    From crate with MIT License 5 votes vote down vote up
productById = {
  type: ProductType,
  args: {
    productId: { type: GraphQLInt }
  },
  resolve: getById
}
Example #18
Source File: mutations.js    From crate with MIT License 5 votes vote down vote up
productUpdate = {
  type: ProductType,
  args: {
    id: {
      name: 'id',
      type: GraphQLInt
    },

    name: {
      name: 'name',
      type: GraphQLString
    },

    slug: {
      name: 'slug',
      type: GraphQLString
    },

    description: {
      name: 'description',
      type: GraphQLString
    },

    type: {
      name: 'type',
      type: GraphQLInt
    },

    gender: {
      name: 'gender',
      type: GraphQLInt
    },

    image: {
      name: 'image',
      type: GraphQLString
    }
  },
  resolve: update
}
Example #19
Source File: query.js    From crate with MIT License 5 votes vote down vote up
subscription = {
  type: SubscriptionType,
  args: {
    id: { type: GraphQLInt }
  },
  resolve: get
}
Example #20
Source File: query.js    From crate with MIT License 5 votes vote down vote up
crateById = {
  type: CrateType,
  args: {
    crateId: { type: GraphQLInt }
  },
  resolve: getById
}
Example #21
Source File: query.js    From crate with MIT License 5 votes vote down vote up
user = {
  type: UserType,
  args: {
    id: { type: GraphQLInt }
  },
  resolve: getById
}