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

    Eric Reis

    01/03/2021, 3:37 AM
    @jasonkuhrt is it not possible to use Nexus without --transpile-only? Im passing a function that takes a generic argument through context and the compiler complains with `Untyped function calls may not accept type arguments.`when I pass it type arguments. https://codesandbox.io/s/laughing-bhabha-zfo83?file=/src/nexus.ts:418-460
    j
    • 2
    • 13
  • j

    John Smeeth

    01/05/2021, 8:32 AM
    hi all
  • j

    John Smeeth

    01/05/2021, 8:33 AM
    how can i user enum defined in schema.prisma in nexus mutation's args? many thanks
    r
    • 2
    • 2
  • s

    sven

    01/05/2021, 2:08 PM
    Help with running nexus + prisma-plugin in production …
    • 1
    • 3
  • v

    Victor

    01/06/2021, 7:26 PM
    👋 Hey guys.. Does "null free lists" also hold true for
    t.model
    ? See https://nexusjs.org/docs/plugins/prisma/api#null-free-lists It mentions that it is for
    t.crud
    but not for
    t.model
    r
    • 2
    • 10
  • d

    Daniell

    01/08/2021, 3:05 PM
    Hi, is nexus type gen not able to resolve types from declaration merging?
    Copy code
    import type { PrismaClient } from "@prisma/client"
    import type { FastifyRequest, FastifyReply } from "fastify"
    
    export interface Context {
      request: FastifyRequest
      reply: FastifyReply
      prisma: PrismaClient
    }
    
    // index.d.ts
    import type { User } from "@prisma/client"
    
    declare module "fastify" {
      type PassportUser = User
    }
    r
    • 2
    • 5
  • d

    Daniell

    01/08/2021, 3:06 PM
    3rd party lib types
  • s

    stephen.pearl

    01/08/2021, 6:35 PM
    Can anyone explain what causes the
    makeSchema
    method to execute during the build process?
    r
    • 2
    • 3
  • s

    stephen.pearl

    01/11/2021, 7:43 PM
    Does nexus support union types? I need to return a list of objects that differ in structure but from a business standpoint they are conceptually the same. Is there an example?
    r
    • 2
    • 1
  • m

    Manthan Mallikarjun

    01/13/2021, 8:04 AM
    Do most people set:
    Copy code
    nonNullDefaults: {
        input: true,
        output: true,
      },
    ?
  • m

    Manthan Mallikarjun

    01/13/2021, 8:04 AM
    Seems like its the safer option
  • m

    Manthan Mallikarjun

    01/13/2021, 8:08 AM
    At least it would better match prisma
    👍 1
    n
    • 2
    • 3
  • m

    Manthan Mallikarjun

    01/13/2021, 8:09 AM
    If you type
    String
    in the prisma schema its a nonNull by default but
    String?
    is nullable
  • u

    장원찬

    01/13/2021, 3:08 PM
    When will the Nexusjs version compatible with Prisma 2.14.0 be released? I wanna stop seeing the warning that the Prisma version is incompatible.
    r
    • 2
    • 2
  • s

    stephen.pearl

    01/13/2021, 3:41 PM
    "Nexus defaults to both inputs and outputs being nullable. This means by default your API is conservative in what it sends but flexible in what it accepts." (https://nexusjs.org/docs/guides/nullability#example-nullability-flipped-at-type-level)
    How is the output "conservative" since results will be null | entity? Seems like
    entity
    is more conservative (when setting noNull output to true.
    r
    • 2
    • 2
  • m

    mikkelsl

    01/13/2021, 4:30 PM
    Finally got to migrate away from Nexus Framework (which is kind of sad though), but my build seems to fail because of missing type definitions, when using
    ts-node
    and
    tsc
    for build:reflection and build. If I run
    ts-node-dev --transpile-only
    before, it will succeed. I shouldn't have to do this during deployment. I can't find anything about this. Any idea how I can succeed with the build without a bunch of type errors?
    r
    c
    • 3
    • 3
  • s

    stephen.pearl

    01/13/2021, 4:49 PM
    What's the best way to bundle nexus using webpack?
  • t

    Timo

    01/15/2021, 5:05 PM
    What's the best way to guard a prisma-plugin field
    t.model
    to return null instead of throwing an error (like when I use
    authorized
    middleware)
    d
    • 2
    • 4
  • s

    sven

    01/15/2021, 5:48 PM
    I followed the tutorial on testing but as soon as I add a few more tests I am getting this error:
    listen EADDRINUSE: address already in use :::4000
    Any ideas?
    d
    r
    • 3
    • 20
  • s

    stephen.pearl

    01/15/2021, 8:57 PM
    What's the best way to create a federatedSchema with nexus?
    • 1
    • 1
  • s

    stephen.pearl

    01/18/2021, 4:07 PM
    Copy code
    name: 'Mutation',
      definition(t) {
        t.crud.createOneUser({ alias: 'signupUser' })
        t.crud.deleteOnePost()  //what is this?
    
        t.field('createDraft', {
          type: 'Post',
          args: {
            title: nonNull(stringArg()),
            content: stringArg(),
            authorEmail: nonNull(stringArg()),
          },
    What's the purpose of
    t.crud.deleteOnePost()
    ?
    r
    • 2
    • 23
  • s

    stephen.pearl

    01/19/2021, 8:49 PM
    Is there a recommended method for handling authentication/authorization (preferably via the apollo context)? I need to get the request, pull header and do some checks.
    r
    • 2
    • 1
  • m

    mikkelsl

    01/21/2021, 12:05 PM
    Any idea why when I deploy my api, I get this error:
    Copy code
    Cannot find module 'apollo-server-express'
    It's not a problem, when I build and run locally. This is my tsconfig.json.
    Copy code
    {
      "compilerOptions": {
        "skipLibCheck": true,
        "esModuleInterop": true,
        "target": "es2018",
        "module": "commonjs",
        "strict": false,
        "outDir": ".build",
        "rootDir": "."
      }
    }
    And my build/start script:
    Copy code
    "build": "yarn build:reflection && yarn tsc",
        "build:reflection": "EXIT_AFTER_REFLECT=true ts-node --transpile-only ./app",
        "start": "NODE_ENV=production node .build/app",
    I miss the framework already! 😄
    d
    • 2
    • 9
  • l

    Luc

    01/22/2021, 9:56 AM
    Hi, is nexus-plugin-prisma still in active development? A long awaited crud feature described here https://github.com/graphql-nexus/nexus-plugin-prisma/issues/598 has been unpinned two weeks ago by @jasonkuhrt. Are you guys planned to continue this plugin development or just maintain it to match new prisma versions? In any cases i cant thank you enough for your amazing work.
    g
    • 2
    • 1
  • y

    Yan

    01/22/2021, 4:17 PM
    Hi, maybe a silly question… but can I generate resolver by Nexus, and feed it and the SDL to the server?
  • y

    Yan

    01/22/2021, 4:18 PM
    And then take Nexus as a devdependency, which only for local dev and no need upload to the cloud.
  • y

    Yan

    01/22/2021, 4:22 PM
    In addition… I have seen strange error when using Nexus with apollo-server-lambda… If I wrote the graphql types and resolvers directly, I could query properly.
    Copy code
    {
      "errorType": "TypeError",
      "errorMessage": "Symbol.prototype [ @@toPrimitive ] requires that 'this' be a Symbol",
      "stack": [
        "TypeError: Symbol.prototype [ @@toPrimitive ] requires that 'this' be a Symbol",
        "    at Symbol.[Symbol.toPrimitive] (<anonymous>)",
        "    at Function.defineProperty (<anonymous>)",
        "    at Object.<anonymous> (/var/task/__index.js:19:8)",
        "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
        "    at Module.load (internal/modules/cjs/loader.js:863:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
        "    at Module.require (internal/modules/cjs/loader.js:887:19)",
        "    at require (internal/modules/cjs/helpers.js:74:18)",
        "    at _tryRequire (/var/runtime/UserFunction.js:75:12)"
      ]
    }
  • y

    Yan

    01/22/2021, 4:23 PM
    Any idea?
    r
    • 2
    • 6
  • m

    mikkelsl

    01/25/2021, 8:38 AM
    If I want to split my resolver into a function like this:
    Copy code
    t.field('event', { type: 'Event', resolve: eventResolver })
    How would I then get proper type checking for the function:
    Copy code
    const eventsResolver = async (root, args, ctx, ...rest) => {}
    r
    • 2
    • 1
  • s

    stephen.pearl

    01/25/2021, 2:32 PM
    Assuming a complex graph, should the user create data node by node or should the user use a mutate request to create the entire document all once?
    r
    • 2
    • 3
1...161718...25Latest