ric0
02/27/2017, 11:30 AMtype Example {
_id: String!
description: String
length: String
}
type Query {
listExamples: [Example]
}
type Mutation {
insertExample(description: String): Example
}
schema {
query: Query
mutation: Mutation
}
//In my resolvers
Mutation: {
insertExample(_, {description}): {
const exampleId = Examples.insert({
description: description,
length: description.length
})
return Examples.findOne(exampleId)
}
},
Query; {
listExample(_){
Examples.find({}).fetch()
}
},
Example({length}) {
const info = length > 25 ? 'LONG' : 'SHORT'
return info
}
Is this possible in graphcool?nilan
02/27/2017, 11:33 AMlenght
client sideric0
02/27/2017, 11:37 AMric0
02/27/2017, 11:59 AMnilan
02/27/2017, 12:31 PMric0
02/27/2017, 12:52 PMnilan
02/27/2017, 12:52 PM