Yannick
04/08/2018, 4:20 PMpasa
04/08/2018, 4:43 PMtype Mutation {
createDraft(title: String!, text: String): Post
deletePost(id: ID!): Post
publish(id: ID!): Post
createSite(urlhash: String!): Site
}
and to index.js:
Mutation: {
createSite(parent, { urlhash }, ctx, info) {
return ctx.db.mutation.createSite(
{
data: {
urlhash
},
},
info,
)
},
},
But I still get the error "Unknown argument 'urlhash' on field 'createSite'", if I call the mutation like this:
mutation{
createSite(urlhash: "dqwda")
{id}
}
pasa
04/08/2018, 4:45 PMpasa
04/08/2018, 5:09 PMeloff
04/08/2018, 5:12 PMpasa
04/08/2018, 5:25 PMeloff
04/08/2018, 5:26 PMhuv1k
04/08/2018, 5:27 PMpasa
04/08/2018, 6:40 PMDevin
04/08/2018, 7:01 PMno Node for the model User with value ...
except when I query me I get back the correct tokenDevin
04/08/2018, 7:01 PMKat
04/08/2018, 8:15 PMKat
04/08/2018, 8:15 PMKat
04/08/2018, 8:16 PMKat
04/08/2018, 8:16 PMmcierpicki
04/08/2018, 8:32 PMAdvice
and connect to it, already created, tags, categories, videos and images. Yet for some reason this this setup does not work - i don't know how to set tags, categories, videos and images inputs so that it does not throw error.
type Mutation {
createAdvice(params: CreateAdviceParams!): Advice
}
type Advice {
id: ID!
name:String!
value: Int!
description: String!
tags: [AdviceTag]!
categories: [AdviceCategory]!
videos: [VideoAsset!]!
images: [ImageAsset!]!
}
input CreateAdviceParams {
name:String!
value: Int!
description: String!
tags: [AdviceTag]
categories: [AdviceCategory]
videos: [VideoAsset]
images: [ImageAsset]
}
Mutation: {
createAdvice(parent, {params}, ctx, info) {
return ctx.db.mutation.createAdvice({data: params}, info)
},
},
mutation {
createAdvice(params:{
name: "Saraasdh"
value: 1,
description: "Jakis tam description",
tags: { connect: [{
id : "cjfr8wmere6bt0a422693ql94"
}]},
categories: { connect: []},
videos: { connect: []},
images: { connect: []}
}) {
id,
name
}
}
Kat
04/08/2018, 8:55 PMpasa
04/08/2018, 9:02 PMmcierpicki
04/08/2018, 10:12 PMpasa
04/08/2018, 10:23 PMpasa
04/08/2018, 10:27 PMharrisrobin
04/08/2018, 10:40 PMharrisrobin
04/08/2018, 10:41 PMpasa
04/08/2018, 10:53 PMPat
04/09/2018, 3:56 AMPat
04/09/2018, 4:01 AMdb.mutation.createProduct({
data: {
name: 'foo',
stores: {
create: [
{
quantity: 0,
store: {
create: { name: store.name },
connect: { name: store.name },
}
},
],
},
},
});
Pat
04/09/2018, 4:02 AMMoritz
04/09/2018, 7:53 AMlancej
04/09/2018, 9:59 AMstevereid
04/09/2018, 12:26 PM