matic
06/29/2018, 1:28 PMconnections
in Prisma API besides Schema itself?
(I might have missed it in the docs as well 🤞)Jenkins
06/29/2018, 3:47 PMVinnie
06/29/2018, 4:38 PMpettanko
06/29/2018, 6:07 PMNick
06/29/2018, 6:35 PMJacob
06/29/2018, 10:41 PMMichael Jones
06/30/2018, 2:56 AMinfo
object in prisma-binding? Basically, always add a field that should be grabbed regardless of the info
object's contents.Gorodov Maksim
06/30/2018, 8:59 AMinput ActionMemberInput {
personId: ID!
side: String!
}
createAction(
title: String!
date: String!
description: String
karma: String!
executors: String!
members: [ActionMemberInput!]!
): Action!
That's schema from frontend:
export const CREATE_ACTION = gql`
mutation createAction(
$title: String!,
$date: String!,
$description: String!,
$karma: String!,
$executors: String!,
$members: [ActionMembersInput!]!,
) {
createAction(
title: $title,
date: $date,
description: $description,
karma: $karma,
executors: $executors,
members: $members,
) {
id
title
date
description
karma
executors
members {
person {
id
name
}
side
}
}
}
`;
When I'm trying to make such mutation from frontend, I get error 404. I guess the problem somewhere there - $members: [ActionMembersInput!]!,
(frontend schema)
I tried to make same mutation from frontend and from playground and it worked in playground but didn't work in frontendGorodov Maksim
06/30/2018, 9:00 AMJim
06/30/2018, 11:19 AMconst { GraphQLServer } = require('graphql-yoga');
const { Prisma } = require('prisma-binding');
const resolvers = require('./resolvers');
const authoriseToken = require('./other/auth');
const helmet = require('helmet');
const server = new GraphQLServer({
typeDefs: './src/schema.graphql',
resolvers,
context: req => ({
...req,
db: new Prisma({
typeDefs: 'src/generated/prisma.graphql', // the auto-generated GraphQL schema of the Prisma API
endpoint: process.env.PRISMA_ENDPOINT, // the endpoint of the Prisma API (value set in `.env`)
debug: true, // log all GraphQL queries & mutations sent to the Prisma API
// secret: process.env.PRISMA_SECRET, // only needed if specified in `database/prisma.yml` (value set in `.env`)
}),
}),
});
server.use(helmet());
<http://server.express.post|server.express.post>('*', authoriseToken);
server.start(() => console.log('Server is running on <http://localhost:4000'>));
artindaniel
06/30/2018, 11:20 AMartindaniel
06/30/2018, 11:21 AMisPostOwner
. How would I get the postID
from the query/mutation?Vinnie
06/30/2018, 3:11 PMSteve
07/01/2018, 12:58 AMjonthewayne
07/01/2018, 1:21 AMjasonkuhrt
Gorodov Maksim
07/01/2018, 4:59 AMtype ActionMember {
id: ID! @unique
person: Person! || User!
side: String!
}
Something like OR operationGorodov Maksim
07/01/2018, 7:08 AMNick
07/01/2018, 10:11 AMuser
07/01/2018, 10:34 AMalexey.rodionov
07/01/2018, 11:11 AMprisma
, graphql-yoga
and apollo-server
.
According to `graphql-yoga`'s docs, graphql-yoga
is based on apollo-server
. Right?
Since apollo-server
supports full WebSocket transport, why graphql-yoga
don't?alexey.rodionov
07/01/2018, 11:46 AMgraphql-yoga
is based on apollo-server
and Apollo Server 2.0 currently is in release candidate stage (https://github.com/apollographql/apollo-server/releases), does this mean that when the Apollo Server 2.0 stable version is officially released, I will be able to use all new mind-blowing features (such as https://dev-blog.apollodata.com/easy-and-performant-graphql-over-rest-e02796993b2b and https://dev-blog.apollodata.com/automatic-persisted-queries-and-cdn-caching-with-apollo-server-2-0-bf42b3a313de) that Apollo Server 2.0 offer directly in graphql-yoga
?Gorodov Maksim
07/01/2018, 5:34 PMVinnie
07/01/2018, 5:46 PMcmcinroy
07/01/2018, 6:38 PMGorodov Maksim
07/02/2018, 3:27 AMSubscription: {
personUpdate: {
subscribe: (parent, args, context, info) => {
return context.prisma.subscription.person({}, info);
},
},
},
How can I detect was person created or deleted on the frontend? I receive completely same data when person was created or deletedGorodov Maksim
07/02/2018, 3:30 AMperson
into array of persons
anytime I receive data from the backend, even when person was deleted because Idk how to detect is this person deleted or created so my application works not how I expectGorodov Maksim
07/02/2018, 6:59 AMGorodov Maksim
07/02/2018, 7:27 AMmartin
07/02/2018, 9:06 AM