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 |
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 |
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 |
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 |
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 |
userRemove = {
type: UserType,
args: {
id: {
name: "id",
type: GraphQLInt,
},
},
resolve: remove,
}
Example #6
Source File: types.js From crate with MIT License | 6 votes |
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 |
subscriptionRemove = {
type: SubscriptionType,
args: {
id: {
name: 'id',
type: GraphQLInt
}
},
resolve: remove
}
Example #8
Source File: mutations.js From crate with MIT License | 6 votes |
subscriptionCreate = {
type: SubscriptionType,
args: {
crateId: {
name: 'crateId',
type: GraphQLInt
}
},
resolve: create
}
Example #9
Source File: types.js From crate with MIT License | 6 votes |
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 |
productRemove = {
type: ProductType,
args: {
id: {
name: 'id',
type: GraphQLInt
}
},
resolve: remove
}
Example #11
Source File: mutations.js From crate with MIT License | 6 votes |
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 |
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 |
crateRemove = {
type: CrateType,
args: {
id: {
name: 'id',
type: GraphQLInt
}
},
resolve: remove
}
Example #14
Source File: mutations.js From crate with MIT License | 6 votes |
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 |
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 |
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 |
productById = {
type: ProductType,
args: {
productId: { type: GraphQLInt }
},
resolve: getById
}
Example #18
Source File: mutations.js From crate with MIT License | 5 votes |
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 |
subscription = {
type: SubscriptionType,
args: {
id: { type: GraphQLInt }
},
resolve: get
}
Example #20
Source File: query.js From crate with MIT License | 5 votes |
crateById = {
type: CrateType,
args: {
crateId: { type: GraphQLInt }
},
resolve: getById
}
Example #21
Source File: query.js From crate with MIT License | 5 votes |
user = {
type: UserType,
args: {
id: { type: GraphQLInt }
},
resolve: getById
}