Brian Speer
11/20/2018, 4:56 PMRamin B
11/20/2018, 5:14 PMPRISMA_ENDPOINT
url. Can someone explain what the different parts of the URL mean and how they map to the prisma server and databse? for example, this URL:
<https://my-prisma-server.herokuapp.com/prisma-heroku-dev/dev>
when I do a prisma deploy
, what information is looking for? how does default
play into all of this? if I deployed to <https://my-prisma-server.herokuapp.com/default/default>
instead, would that essentially create my tables in the default
schema in my db?Kevin S
11/20/2018, 10:48 PMKevin S
11/20/2018, 10:49 PMKevin S
11/20/2018, 10:57 PMKevin S
11/20/2018, 11:04 PMhuv1k
11/20/2018, 11:06 PMKevin S
11/20/2018, 11:24 PMBruna Aleixo
11/20/2018, 11:55 PMmutation {
updateOrder(
id: "cjoq8c91d0nb701103qy545x3",
orderItems: [{
quantity: 1,
itemId: "cjollwnqt06o90179wzsqbm7d",
}]
) {
id
}
}
My data schema is:
type Order @model {
createdAt: DateTime!
id: ID! @isUnique
table: Int!
orderItems: [OrderItem!]! @relation(name: "OrderItems")
}
type OrderItem @model {
id: ID! @isUnique
quantity: Int!
item: Item! @relation(name: "OrderItem")
order: Order! @relation(name: "OrderItems")
}
And I keep getting the following error:
"message": "Argument 'orderItems' expected type '[OrderorderItemsItem!]' but got: [{quantity: 1, itemId: \"cjollwnqt06o90179wzsqbm7d\"}]. Reason: '[0].quantity' Field 'quantity' is not defined in the input type 'OrderorderItemsItem'. (line 4, column 17):\n orderItems: [{\n ^\n (line 5, column 7):\n quantity: 1,\n ^",
shawnmmatthews
11/21/2018, 12:11 AMRoman Z.
11/21/2018, 7:30 AMtype User @db(name: "users")
{
id: ID! @id
name: String! @unique
property: Property! @relation(link: INLINE)
}
type Property @db(name: "properties")
{
id: ID! @id
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
propertyName: String!
users: [User!]! @relation(strategy: EMBED)
}
Currently I have this query that allows me to query users by name:
query {
user(where: {name: "john"}) {
id,
name,
property {
propertyName
}
}
}
But what I need is: to extend it to include filter
by propertyName
and seems like prisma's generator is not creating relational filters for me as in this example:
https://www.prisma.io/forum/t/graphql-query-structure-how-can-i-return-a-deeply-nested-array-up-top/455/2
pls halp 🙏prilutskiy
11/21/2018, 8:18 AMIndustrial
11/21/2018, 8:55 AMIndustrial
11/21/2018, 8:56 AMgraphqlgen
has been released but I have some problems with it.Lobo
11/21/2018, 9:40 AMtype Video {
id: ID! @unique
title: String!
tags: [Tag!]!
}
with the mutation:
createVideo(
title: String!,
tagsIds: [ID!],
): Video!
and this is what I have right now in the resolver... I've tried several things
createVideo: (root, args, context, info) => {
return context.db.mutation.createVideo({
data: {
title: args.title,
tags: {
connect: {
id: args.tagsIds
}
},
},
}, info)
},
},
This is what I'm sending, the two IDs I'm sending are tags that exist on database:
mutation {
createVideo(
title: "Neehar Venugopal - A Beginner's Guide to Code Splitting Your React App - React Conf 2017"
tagsIds: ["cjoopece2000a0899n8jsjkr4", "cjoo9e0eq004d0824nibmtzl2"],
) {
id
}
}
probably missing something basic... but I haven't found much information about how to send a group of IDs related to another table
any help will be appreciated 🙂
and this is the error I'm getting, by the way...
Expected type ID at value.id; ID cannot represent value: ["cjoopece2000a0899n8jsjkr4", "cjoo9e0eq004d0824nibmtzl2"]
Nick
11/21/2018, 10:14 AMtheom
11/21/2018, 11:25 AMconst UPDATE_ITEM_MUTATION = gql`
mutation updateItem_mutation($id: ID!, $quantity: Int){
updateItem(
data: {
quantity: $quantity
}
where: {
id: $id
}
) {
id
quantity
}
}
`;
const { client } = this.props;
const updateItemMutation = (itemID, quantityValue) => {
const id = itemID;
const quantity = quantityValue;
console.log('item id = ', id);
console.log('quantity = ', quantity);
client.mutate({
mutation: UPDATE_ITEM_MUTATION,
variables: {
id,
quantity,
},
}).catch(this.handleSubmitError);
}
What am I overlooking here?jdoyle112
11/21/2018, 2:44 PMJørgen V
11/21/2018, 2:56 PMJørgen V
11/21/2018, 2:56 PMjdoyle112
11/21/2018, 3:11 PMandrux
11/21/2018, 6:08 PMonePunchMan
11/21/2018, 6:15 PMnotrab
11/21/2018, 6:16 PMgraphql-request
but I really want to reduce some of the mutations that are only really used by the microservices/background jobs.Michael
11/21/2018, 6:21 PMrwatts3
11/21/2018, 7:16 PMrwatts3
11/21/2018, 7:24 PMKrisTemmerman
11/21/2018, 8:50 PMonePunchMan
11/21/2018, 8:57 PMprisma deploy
it is telling me that id is requiredonePunchMan
11/21/2018, 8:58 PM