mikkelsl
02/14/2019, 6:09 PMimpowski
02/14/2019, 6:11 PMimpowski
02/14/2019, 6:12 PMlawjolla
02/14/2019, 6:14 PMnexus-prisma
into an existing Apollo Server / Prisma server? I'd like to migrate, but I don't have my head around what that path might look likeKaushal
02/14/2019, 8:02 PMArjun Karnwal
02/14/2019, 9:51 PMArjun Karnwal
02/14/2019, 9:51 PMRamin B
02/15/2019, 12:04 AMArnab
02/15/2019, 9:43 AMOmprakash
02/15/2019, 10:11 AMAitor
02/15/2019, 10:21 AMrein
02/15/2019, 10:39 AMrein
02/15/2019, 10:40 AMrein
02/15/2019, 12:10 PMlewisedc
02/15/2019, 2:03 PMnsignes
02/15/2019, 2:05 PMmutation {
q1: updateMyObject(...){...},
q2: updateMyOtherObject(...){...}
}Do Prisma guarantee the order of execution and transaction all the queries (ie, if q2 fails for some reason, would q1 be rollbacked ?) I know GraphQL server are supposed to guarantee the order of action when receiving multiple mutations, and I read that Prisma mutation are atomic (though that article could refer to nested mutation too...), but if anyone has a more direct prisma-related knowledge on this case, I'd be grateful... Thanks for any info !
ohorovsky
02/15/2019, 2:26 PMohorovsky
02/15/2019, 2:27 PMohorovsky
02/15/2019, 2:27 PMjoan
02/15/2019, 4:19 PMdates
field? I get this error message:
[GraphQL error]: Message: Variable '$data' expected value of type 'EventUpdateInput!' but got: {"title":"title here","slug":"title-here","description":"lorem ipsum.","dates":["2019-02-28T11:11"]}. Reason: 'dates' Expected 'EventUpdatedatesInput', found not an object. (line 1, column 43):
mutation ($where: EventWhereUniqueInput!, $data: EventUpdateInput!) {
^, Location: [object Object], Path: updateEvent
I get that error when trying to run a mutation to update an event:
const UPDATE_EVENT_MUTATION = gql`
mutation UpdateEventMutation($id: ID!, $title: String!, $slug: String!, $description: String, $dates: [String]) {
updateEvent(id: $id, title: $title, slug: $slug, description: $description, dates: $dates) {
id
title
description
dates
}
}
`;
graphql.schema:
type Mutation {
updateEvent(id: ID!, title: String!, slug: String!, description: String, dates: [String]): Event
}
type Event {
id: ID!
slug: String!
title: String!
description: String
dates: [String]
places: [Place]
menus: [String]
}
auto generated prisma.schema:
input EventUpdatedatesInput {
set: [String!]
}
updateEvent(data: EventUpdateInput!, where: EventWhereUniqueInput!): Event
joan
02/15/2019, 4:20 PMlawjolla
02/15/2019, 4:35 PMmharrvic
02/15/2019, 7:01 PMAdam Tsai
02/15/2019, 8:08 PMAdam Tsai
02/15/2019, 8:21 PMjoan
02/15/2019, 8:54 PMevent
with a new array of `places`: Reason: 'places' Expected 'PlaceUpdateManyInput', found not an object
const UPDATE_EVENT_MUTATION = gql`
mutation UpdateEventMutation($id: ID!, $title: String!, $slug: String!, $description: String, $dates: [String], $places: [PlaceInput]) {
updateEvent(id: $id, title: $title, slug: $slug, description: $description, dates: $dates, places: $places) {
id
title
description
dates
places {
name
url
}
}
}
`;
// Resolver
updateEvent(parent, { id, title, slug, description, dates, places }, context) {
return context.prisma.updateEvent({
where: { id },
data: { title, slug, description, dates: { set: dates }, places },
});
},
// graphql schema
type Mutation {
updateEvent(id: ID!, title: String!, slug: String!, description: String, dates: [String], places: [PlaceInput]): Event
}
input PlaceInput {
name: String!
url: String
}
type Place {
id: ID!
name: String!
url: String
}
type Event {
id: ID!
slug: String!
title: String!
description: String
dates: [String]
places: [Place]
menus: [String]
}
ryan
02/15/2019, 8:58 PMpermissions
root property that could go in prisma.yml
but perhaps that’s no longer? my usecase right now isn’t that complex, I actually just want to make certain models read-onlyElektrikSpark
02/15/2019, 10:23 PMMike
02/15/2019, 10:42 PMvscode-graphql
extension is DOSing their servers and they've had to block my IP. @ElektrikSpark @Adam Tsai Are you guys using that extension for vscode?
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphqlElektrikSpark
02/15/2019, 10:46 PM