https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# graphql-nexus
  • j

    John Mark

    03/05/2020, 8:59 PM
    Hey there! We're having an N+1 issue with nexus-prisma on nested queries. It seems like nexus-prisma is resolving fields using findOne here (snippet from nexus-prisma builder.ts):
    Copy code
    const 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.
  • j

    John Mark

    03/05/2020, 9:00 PM
    We do rely on nexus for generating types, so in lieu of moving away from it, we're looking to see if there's a possible workaround that would let us run the query directly. If anyone knows how we can do this, an example would be incredibly appreciated!
    j
    • 2
    • 3
  • e

    Emre Ozdemir

    03/16/2020, 10:13 PM
    Has anyone been able to use
    nexus
    with
    apollo-client
    and
    apollo-link-state
    to handle client local state?
  • a

    Awey

    03/19/2020, 9:35 PM
    eta on when this the tutorial will be back up? https://github.com/prisma/prisma2/blob/2.0.0-preview024/docs/tutorial.md
  • a

    Andrew O.

    03/19/2020, 10:39 PM
    Hey, is there a way to connect a client created with GraphQL-CLI into Nexus in the same way Nexus-Prisma connects? Meaning able to pass through and extend.
  • a

    Andrew O.

    03/19/2020, 10:39 PM
    This would be extremely helpful, of if someone can point me in the right direction to do it myself.
  • a

    Andrew O.

    03/19/2020, 10:41 PM
    Question 2, how can I implement graphql-sequelize into a
  • a

    Andrew O.

    03/19/2020, 10:42 PM
    t.connectionField(
    ${TypeNames.name}s_connection
    , {             type: TypeNames.name,             resolve: async (root, args, ctx, info) => {             }         });
  • m

    martin

    03/22/2020, 8:07 PM
    Having issues deploying a GraphQL Server to Zeit’s now service with
    nexus
    . 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.
    Copy code
    // 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
    Copy code
    {
      "version": 2,
      "builds": [
        {
          "src": "src/index.js",
          "use": "@now/node-server"
        }
      ],
      "routes": [
        {
          "src": "./*",
          "dest": "src/index.js"
        }
      ]
    }
  • a

    Andrew O.

    03/26/2020, 4:50 PM
    So any know how to do testing with Jenkins on Nexus?
  • a

    Andrew O.

    03/26/2020, 4:51 PM
    Is there a way to turn the NexusSchema into an executable schema? We already have tests written for a schema first approach, but we switched to Nexus and don't want our test coverage to go down.
    w
    • 2
    • 3
  • j

    Jeremy

    04/04/2020, 3:17 AM
    @martin This is the same with me, I managed to deploy mine to Netlify but unsure how to access the my graphQL api from the netlify url they made
  • a

    Alex Vilchis

    04/06/2020, 4:40 PM
    Hello 👋 If I am building a production application with Nexus and Prisma, which combination should I use? • Nexus Future & Prisma 2 • Nexus Schema & Prisma 2 Thank you
    v
    • 2
    • 1
  • c

    carter.rabasa

    04/06/2020, 7:40 PM
    Has anyone gotten Nexus running on AWS Lambda (or any serverless environment) ?
    👀 1
    j
    • 2
    • 1
  • c

    carter.rabasa

    04/06/2020, 11:10 PM
    Hmmm… has anyone gotten Nexus running in Heroku using the instructions in their tutorial? I am getting
    app boot timeout
    errors.
  • m

    Maxim Ignatev

    04/08/2020, 5:02 PM
    Hi guys. is there a way to do include auth logic inside nexus crud operations?
    a
    v
    • 3
    • 2
  • a

    Awey

    04/12/2020, 12:25 AM
    nextjs example?
    s
    • 2
    • 1
  • h

    huv1k

    04/13/2020, 2:36 PM
    It would be nice to show some loading indicator during installing dependencies
    s
    • 2
    • 1
  • j

    James Homer

    04/15/2020, 4:18 PM
    Can anyone help with this issue? https://github.com/graphql-nexus/nexus-schema-plugin-prisma/issues/419
  • j

    James Homer

    04/15/2020, 4:26 PM
    It refers to the
    did you forget to import a type to the root query
    error
  • j

    James Homer

    04/16/2020, 12:33 PM
    Is there a way to add a callback to a
    crud
    operation? I want to publish to a pubsub channel on update. Do I need to recreate the operation manually in order to do this?
    👍 2
  • d

    Darryl

    04/16/2020, 1:29 PM
    When creating your own mutation, is there a way to automatically generate the args based on an auto-generated CRUD operation? For example, if I have a
    Product
    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?
    r
    • 2
    • 8
  • c

    Cameron

    04/17/2020, 5:10 AM
    Anybody here use
    graphql-shield
    with
    nexus@next
    ??
    👍 1
    j
    • 2
    • 3
  • d

    Dan Borstelmann

    04/17/2020, 5:40 AM
    Anybody know how to get a count on a relation field in nexus-prisma? For example:
    Copy code
    export const User = objectType({
      name: 'User',
      definition(t) {
        t.model.id();
        t.model.followers({
          type: 'OtherUser',  
        }).count;
      },
    });
    t
    • 2
    • 11
  • b

    brandon

    04/17/2020, 9:00 PM
    Has anyone successfully launch nexus on netlify?
  • b

    brandon

    04/17/2020, 9:03 PM
    I’m trying to simply use netlify in order to introspect my queries in a development environment.
  • d

    Dan Borstelmann

    04/19/2020, 9:39 PM
    I'm trying to do an upsert during a connect and it does not appear that this is a feature. Anybody done something like
    Copy code
    create {
      field: {
        upsert {}
      }
    }
  • d

    Dan Borstelmann

    04/20/2020, 5:12 AM
    Anybody know if you can
    extendType
    a model in nexus and then use
    t.crud
    to expose it?
  • a

    Andrew Rhyne

    04/20/2020, 4:42 PM
    Hey, quick question (cc @tgriesser)
  • a

    Andrew Rhyne

    04/20/2020, 4:42 PM
    https://github.com/graphql-nexus/schema/blob/develop/examples/ghost/src/data-sources/Context.ts < looking at the Ghost example, I wanted some clarification around how this pattern avoids memory leaks?  It appears that 
    Context
     references the data sources, and that the datasources reference 
    Context
12345...25Latest