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

    Ahmed

    09/30/2020, 5:27 PM
    Yes, I also like this decision
    👍 3
    💯 6
  • p

    Petr Homoky

    09/30/2020, 5:46 PM
    Yes, the desicion is great. Focus on schema is more important than on server (framework) where everybody has different needs. Hope this will keep for a long time (focus on @nexus/schema)…
    👍 6
  • m

    Matt

    09/30/2020, 6:22 PM
    I've been using Yoga for my GQL server. It was going to be replaced by Nexus framework. Now that that is no longer a thing - which I'm totally fine with - what server(s) do people find works best for them since Yoga isn't really supported anymore?
    j
    t
    d
    • 4
    • 5
  • d

    Daniel Mahon

    09/30/2020, 7:42 PM
    after following the conversion guide back to schema, I cant seem to get the nexus & prisma plugin typings generated anymore, they are supposed to default output to @typings right? and should be generated when running ts-node on the schema.ts file?
    j
    y
    t
    • 4
    • 6
  • d

    Dave

    09/30/2020, 9:02 PM
    If you have an object defined as follows:
    const Post = objectType({
      
    name: 'Post',
     
    definition(t) {
    <http://t.int|t.int>('id')
      
    t.string('title')
     
    },
    })
    r
    • 2
    • 3
  • p

    Pani Avula

    10/01/2020, 12:59 AM
    @jasonkuhrt do we have any roadmap defined for @nexus/schema? My recommendation would be to 1. simplify bootstrapping configuration 2. support federation support with apollo 3. support for golang and other languages defined in prisma roadmap. This helps to define purpose more cleanly (enabling graphql APIs). It keeps it more aligned with prisma roadmap on language support and so the overall commercial cloud offering. We are living in a polyglot micro service world. It would be imperative for prisma to support multi language to sustain longer.
    👀 1
    💯 1
    a
    j
    • 3
    • 3
  • j

    Justin Voitel

    10/01/2020, 7:33 AM
    @jasonkuhrt I really loved the hooking system of nexus where you could hook into the lifecycles of dev or build and run code between them. Now with nexus disappearing is there a recommended approach/server/library to archive that ? For now Iam looking to get: dev -> onStart, onFileChange and build -> onStart going. I guess some way of combining AS2 + chokidar would do it right? Looking forward with help on this
    j
    • 2
    • 3
  • a

    Albert Gao

    10/01/2020, 10:53 AM
    I use
    t.connection
    previously when using nexus, so I need to write all the type definitions by myself I suppose…. or does nexus/schema supports it? seems not?
    t
    j
    • 3
    • 3
  • a

    Albert Gao

    10/01/2020, 10:54 AM
  • j

    Josef Henryson

    10/01/2020, 2:27 PM
    If I add a resolver field to my prismaObjectType - is it possible to include that field in the WhereInput somehow? When I generate new code, I still only see the fields that exist in my datamodel/database. I run Nexus 0.11.7 and Prisma 1.34
    w
    • 2
    • 2
  • a

    Albert Gao

    10/01/2020, 10:25 PM
    Now the prisma/client is a peer dep of nexus-prisma-plugin which is super good, no need to wait for catching up with Prisma ver, but why a static ver? So the nexus-prisma-plugin still need to work with a specific version of Prisma?
    j
    • 2
    • 3
  • j

    James Homer

    10/02/2020, 11:31 AM
    Am I missing something or have nested upserts disappeared?! I just transitioned back to schema from framework and I used to be able to
    upsert
    a relation field when `create`ing.
  • e

    Eric Reis

    10/03/2020, 6:21 PM
    Is there any way of overwriting the default resolvers when implementing an interface? Apparently there was a t.modify api that helped with this but its been deprecated
  • e

    Eric Reis

    10/03/2020, 6:22 PM
    interface resolvers shouldnt even be a thing tbh
  • p

    Peter

    10/03/2020, 10:13 PM
    Hi A few months ago I use the nexus framework to setup a server. Currently is hard to find documentation. Something was change and nexus server are deprecated? Which server I should use now?
    a
    • 2
    • 5
  • m

    mikkelsl

    10/04/2020, 12:35 PM
    Following the example from here: https://nexusjs.org/docs/adoption-guides/neuxs-framework-prisma-users#configuring-custom-scalars Does anyone know why I might get this error:
    Missing type Json, did you forget to import a type to the root query?
    l
    • 2
    • 1
  • d

    Dave

    10/04/2020, 1:19 PM
    Is there any way to run nexus under SSL? This is how I'm currently setting up nexus, but there doesn't seem to be any settings to change this
    Copy code
    import app, { server, settings } from "nexus";
    
    app.on.start(() => {})
    
    settings.change({
      server: {
        host: '<http://192.168.1.10>',
        port: 4000,
        path: '/',
      },
    })
    
    app.assemble();
    a
    • 2
    • 1
  • c

    cedric

    10/04/2020, 10:08 PM
    so i'm running into an issue with a custom input type that i cannot figure out... i have an input like this:
    Copy code
    export const CreateSelectionInput = inputObjectType({
      name: 'CreateSelectionInput',
      definition(t) {
        t.string('labelVersionId', { required: true });
        t.string('name', { required: false });
        t.list.string('elementIds', { nullable: false });
        t.string('componentIds', { list: true, required: false });
        t.field('bounds', { type: GeoJsonPolygonInput, required: false });
      },
    });
    you'll notice i'm experimenting with a few different options with
    elementIds
    and
    componentIds
    . this config above generates the following sdl:
    Copy code
    input CreateSelectionInput {
      bounds: GeoJsonPolygonInput
      componentIds: [String]
      elementIds: [String]!
      labelVersionId: String!
      name: String
    }
    you'however, i can't seem to figure out the correct configuration to get the following sdl:
    Copy code
    input CreateSelectionInput {
      bounds: GeoJsonPolygonInput
      componentIds: [String!]
      elementIds: [String!]
      labelVersionId: String!
      name: String
    }
    essentially, i want to have an optional list of non-nullable strings (
    elementIds
    and
    componentIds
    ). i can't seem to find any examples of this online.
    a
    • 2
    • 13
  • a

    Albert Gao

    10/05/2020, 7:05 AM
    t.list.string('tagIds')
    will give me a GraphQL type like
    tagIds: [String]
    ,
    t.list.string('tagIds',{required:true})
    results in
    tagIds:[String]!
    how could i get a type like this:
    tagIds: [String!]
    r
    g
    a
    • 4
    • 16
  • p

    Peter

    10/05/2020, 10:39 AM
    Where I could read something about security rules or performance practice. In nexus docs I saw only this page https://nexusjs.org/docs/guides/best-practices I thinking most on looping quere request if I return some full object type.
  • a

    Adam

    10/05/2020, 7:24 PM
    is there anyway to setup the
    auth
    header for the apollo playground requests?
    c
    • 2
    • 1
  • w

    windkomo

    10/06/2020, 8:38 PM
    I have some models where graphql inputs are not generated properly. I need input
    UserCreateInput
    but there’s only
    UserCreateWithoutPostsInput
    . What decides whether the plain input is generated or not ?
    a
    • 2
    • 7
  • a

    Albert Gao

    10/07/2020, 4:48 AM
    got this problem when build, what i did wrong here? I am using Apollo server + nexus/schema + nexus-prisma-plugin combo > node_modules/@types/typegen-nexus-plugin-prisma/index.d.ts126 - error TS2307: Cannot find module ‘nexus-plugin-prisma/typegen’ or its corresponding type declarations.
    l
    • 2
    • 3
  • t

    Taras Protchenko

    10/07/2020, 11:18 AM
    When deploying to Heroku i got this error:
    Copy code
    remote: Type error: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
    remote: 
    remote:   19 |   name: 'User',
    remote:   20 |   definition(t) {
    remote: > 21 |     t.model.id()
    remote:      |       ^
    Maybe this connected with @nexus/schema or nexus-plugin-prisma?
    Copy code
    "nexus-plugin-prisma": "^0.19.0",
    "@nexus/schema": "^0.16.0",
    r
    d
    • 3
    • 7
  • w

    windkomo

    10/07/2020, 1:55 PM
    using nexus schema, do I need to export mutations and add them to types key of makeSchema? They don’t appear in playground until I do it. I thought
    Copy code
    extendType({
      type: 'Mutation',
      definition(t) {
        t.field('sendMessage', {
          type: 'Message',
    was enough
    r
    a
    • 3
    • 5
  • a

    Adam

    10/07/2020, 7:17 PM
    In my schema I have a
    Project
    that is related to an
    Organization
    I would like to
    createOneProject
    by just specifying teh organization ID but it generates as requiring the whole
    organization
    object.
    Copy code
    //Simplified
    model Organization {
      id        Int        @id @default(autoincrement())
      name      String?
      projects  Project[]
    }
    
    model Project {
      id          Int       @id @default(autoincrement())
      organization Organization @relation(fields: [organizationId], references: [id])
      organizationId Int
      name        String
    }
    I'm using the
    experimentalCRUD
    to generate
    createOneProject
    but it auto generates with
    Copy code
    type Mutation {
    createOneProject(data: ProjectCreateInput!): Project!
    }
    Where
    Copy code
    type Project {
      id: Int!
      name: String!
      organizationId: Int!
    }
    
    input ProjectCreateInput {
      name: String!
      organization: OrganizationCreateOneWithoutProjectsInput!
    }
  • a

    Adam

    10/07/2020, 7:21 PM
    can I remove
    organization Organization @relation(fields: [organizationId], references: [id])
    from the
    Project
    in
    schema.prisma
    ? so that I only have the
    organizationId
    field? Or would I lose that relation?
  • a

    Adam

    10/07/2020, 7:29 PM
    nvmd figured out this whole
    connect
    function
    💯 1
  • m

    Mikastark

    10/08/2020, 10:18 AM
    Hello there 🙂 little question about
    @nexus/schema
    . If you look at
    outputs.typegen
    typedoc in SchemaConfig (makeSchema function param) it says "Set to true to enable and emit into default path ... The default path is node_modules/@types/nexus-typegen/index.d.ts." but if I set the value to
    true
    instead of a path (like
    ___dirname +_ '/../node_modules/@types/nexus-typegen/index.d.ts'
    ), it generates nothing. I am doing something wrong or is it normal ?
    r
    • 2
    • 4
  • e

    Eric Reis

    10/09/2020, 12:00 AM
    @jasonkuhrt it'd be interesting if we could pass in the TS type to a field definition that will override the scalar's type, ex:
    Copy code
    objectType({
      name: 'User',
      definition: t => {
          t.id<UserId>('id')
      }
    })
    this is interesting when youre using nominal types, which is something might be builtin to TS one day https://github.com/microsoft/TypeScript/issues/202#issuecomment-695912785
    r
    j
    • 3
    • 4
1...111213...25Latest