John Mark
03/05/2020, 8:59 PMconst fieldConfig = this.buildFieldConfig({
field,
publisherConfig,
typeName,
resolve:
field.outputType.kind === 'object'
? (root, args, ctx) => {
const photon = this.getPhoton(ctx)
return photon[lowerFirst(mapping.model)]
['findOne']({
where: { [idField.name]: root[idField.name] },
})
[field.name](args)
}
: undefined,
})
Which is causing hundreds of queries for a moderately-sized three-level nesting query. The generated queries when running this query directly from prisma look fine, so we're pretty certain that this field resolver is causing the problem.John Mark
03/05/2020, 9:00 PMEmre Ozdemir
03/16/2020, 10:13 PMnexus
with apollo-client
and apollo-link-state
to handle client local state?Awey
03/19/2020, 9:35 PMAndrew O.
03/19/2020, 10:39 PMAndrew O.
03/19/2020, 10:39 PMAndrew O.
03/19/2020, 10:41 PMAndrew O.
03/19/2020, 10:42 PM${TypeNames.name}s_connection
, {
type: TypeNames.name,
resolve: async (root, args, ctx, info) => {
}
});martin
03/22/2020, 8:07 PMnexus
. Local development (via nodemon) works without a hitch. Might anyone know why? I couldn’t find any examples for GraphQL Yoga & Nexus in JS with now deployment.
Getting the 502: BAD_GATEWAY Code: NO_STATUS_CODE_FROM_FUNCTION
error.
// Packages
import { GraphQLServer } from 'graphql-yoga'
import { nexusPrismaPlugin } from 'nexus-prisma'
import { makeSchema } from 'nexus'
import { PrismaClient } from '@prisma/client'
// Types & Resolvers
import types from './types'
import resolvers from './resolvers'
const prisma = new PrismaClient()
const client =
process.env.NODE_ENV === 'development' ? process.env.CLIENT_DEV : process.env.CLIENT_PRO
const server =
process.env.NODE_ENV === 'development' ? process.env.SERVER_DEV : process.env.SERVER_PRO
new GraphQLServer({
schema: makeSchema({
types: { ...types, ...resolvers },
plugins: [nexusPrismaPlugin()],
outputs: {
schema: __dirname + '/schema.graphql'
}
}),
context: ctx => ({ ...ctx, prisma })
}).start(
{
port: 4000,
cors: { credentials: true, origin: [client] }
},
() => console.log(`🚀 Server ready at: ${server} ⭐️`)
)
now.json file
{
"version": 2,
"builds": [
{
"src": "src/index.js",
"use": "@now/node-server"
}
],
"routes": [
{
"src": "./*",
"dest": "src/index.js"
}
]
}
Andrew O.
03/26/2020, 4:50 PMAndrew O.
03/26/2020, 4:51 PMJeremy
04/04/2020, 3:17 AMAlex Vilchis
04/06/2020, 4:40 PMcarter.rabasa
04/06/2020, 7:40 PMcarter.rabasa
04/06/2020, 11:10 PMapp boot timeout
errors.Maxim Ignatev
04/08/2020, 5:02 PMAwey
04/12/2020, 12:25 AMhuv1k
04/13/2020, 2:36 PMJames Homer
04/15/2020, 4:18 PMJames Homer
04/15/2020, 4:26 PMdid you forget to import a type to the root query
errorJames Homer
04/16/2020, 12:33 PMcrud
operation? I want to publish to a pubsub channel on update. Do I need to recreate the operation manually in order to do this?Darryl
04/16/2020, 1:29 PMProduct
model I get an auto-generated prisma.createProduct
. If, however, I want to do something a little more complex when creating a product, do I have to manually write all the input args?Cameron
04/17/2020, 5:10 AMgraphql-shield
with nexus@next
??Dan Borstelmann
04/17/2020, 5:40 AMexport const User = objectType({
name: 'User',
definition(t) {
t.model.id();
t.model.followers({
type: 'OtherUser',
}).count;
},
});
brandon
04/17/2020, 9:00 PMbrandon
04/17/2020, 9:03 PMDan Borstelmann
04/19/2020, 9:39 PMcreate {
field: {
upsert {}
}
}
Dan Borstelmann
04/20/2020, 5:12 AMextendType
a model in nexus and then use t.crud
to expose it?Andrew Rhyne
04/20/2020, 4:42 PMAndrew Rhyne
04/20/2020, 4:42 PMContext
references the data sources, and that the datasources reference Context