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

    jasonkuhrt

    08/10/2019, 1:26 PM
    set the channel topic: https://github.com/prisma/nexus
  • c

    César Rodríguez

    08/12/2019, 12:11 PM
    does anyone know good / complex gh repo with integration between nexus & prisma ? (besides the ones in prisma examples)
    j
    • 2
    • 1
  • j

    jasonkuhrt

    08/23/2019, 2:51 AM
    Hey @tgriesser small but important one (for
    nexus-prisma
    ), would love your feedback https://github.com/prisma/nexus/pull/205
  • t

    tafelito

    08/27/2019, 9:25 PM
    I’m having an issue when I try to get the count aggregation from my model connection. I’m using nexus-prisma 0.3.7. I saw a few issues still open, like this https://github.com/prisma/nexus-prisma/issues/157 or https://github.com/prisma/nexus-prisma/issues/184. Is this not possible to do with today or are this issues a different thing? I’m trying to do a pagination and get the total count of rows. If I run the agg query on my resolver that works, but not when delegating the queries to nexus
  • j

    jasonkuhrt

    09/03/2019, 2:04 PM
    I am unconvinced by the reliability of TypeScript interface merging. Latest episode: I opened
    nexus-prisma/example
    and suddenly got type errors saying
    .model
    and
    .crud
    did not exist. It had been working a day before. I re-ran yarn to refresh deps, no effect, I opened
    node_modules/nexus
    and navigated to the
    src/definitionBlock.ts
    file (where the
    ... extends NexusGenCustomOutputProperties ...
    magic happens, and then the
    .crud
    and
    .models
    started type checking CC @weakky @tgriesser after a year at this, what’s your take on this area?
    😄 1
    🤷‍♂️ 1
    w
    t
    • 3
    • 20
  • k

    koufatzis

    09/05/2019, 7:14 AM
    Hey, I experience issues like the following:
    Type 'Promise<string | undefined>' is not assignable to type 'MaybePromise<string>'.
    in my resolvers. Is there any solution for that?
  • t

    tafelito

    09/05/2019, 2:26 PM
    since this issue https://github.com/prisma/nexus-prisma/issues/184 is preventing to query the count aggregation, is there anyway to resolve that specific field manually in a field resolver and access the parent args? I didn’t find a way to get them
  • t

    tafelito

    09/05/2019, 2:28 PM
    Copy code
    export const CategoryConnection = prismaObjectType({
      name: "CategoryConnection",
      definition(t) {
        t.prismaFields({ filter: ["aggregate"] });
    
        t.field("aggregate", {
          type: "AggregateCategory",
          resolve(root, args, { prisma }, info) {
            // args is empty here
            return {
              // @ts-ignore
              ...root.aggregate,
            };
          },
        });
      },
    });
  • m

    Martí Crespí

    09/10/2019, 10:24 AM
    Hi, someone can help me, please? https://github.com/prisma/nexus-prisma/issues/369
  • b

    brikou

    09/17/2019, 7:45 AM
    Hi there I have a PR to launch tests on examples, feedback appreciated 🙂 https://github.com/prisma/nexus/pull/220
  • j

    Josef Henryson

    09/17/2019, 8:04 AM
    I get this error when running tsc: build in VS Code:
    Copy code
    api/prisma/nexus-prisma/nexus-prisma.ts:2580:54 - error TS2694: Namespace '"/Users/.../prisma-client/index"' has no exported member 'VisibleDocuments'. 
    2580     ) => Promise<prisma.VisibleDocuments[]> | prisma.VisibleDocuments[]
    I look in prisma-client/index.ts and I see this:
    Copy code
    export const models: Model[] = [
    ...
      {
        name: "VisibleDocuments",
        embedded: false
      },
    Any ideas why this happen? I’m quite new to TS and most of my code is JS, just the generated prisma & nexus is TS.
  • j

    Josef Henryson

    09/17/2019, 11:06 AM
    I guess that since both prisma-client & nexus-prisma is generated code, the error must be somewhere in my datamodel?
  • j

    Josef Henryson

    09/17/2019, 1:27 PM
    Nevermind, it seems like my problems were due to my TS setup being wrong. I manually copied my transpiled .js files into the generated folders and the I could start my schema & server. I just need to figure out how to set this up in my build process…
  • j

    Josef Henryson

    09/19/2019, 11:36 AM
    How do you handle JSON types from Graphcool when migrating to nexus & prisma? Do you create a scalar type for JSON? Can you please provide me an example on how to do this properly? I would be forever grateful 🙏🏼 EDIT: I managed to add a JSON scalar type and use it properly.
  • j

    Josef Henryson

    09/19/2019, 1:38 PM
    What is the quickest way to add an alias to expose a nexus field with a different name? I.e: users() => allUsers()
    n
    • 2
    • 10
  • j

    Josef Henryson

    09/20/2019, 3:45 PM
    “Unknown prisma-client function for field UserConnection.aggregate” Any ideas why this is not generated? Or may it be that I use / call it the wrong way?
    t
    • 2
    • 3
  • j

    jasonkuhrt

    09/20/2019, 7:45 PM
    @Victor Dombrovskiy 👋🏻 if you have a minute let me know about https://github.com/prisma/nexus-prisma/issues/330
  • j

    Josef Henryson

    09/24/2019, 7:03 AM
    I made an example below to illustrate my current solution for a resolver I need. I suspect it is not optimal however. On a Shelf I want to know if there is any Book but I go through all books and looks for shelf ID. Is there a way to call BooksConnection for the current Shelf only?
    Copy code
    const Shelf = prismaObjectType({
        name: 'Shelf',
        definition: t => {
            t.prismaFields(['*'])
            t.field('hasBooks', {
                type: 'Boolean',
                resolve: async (root, args, ctx) => {
                    return await ctx.prisma.booksConnection({ where: { shelf: { id: root.id }}})
    	            	.aggregate()
    	            	.count() > 0
                }
            })
        }
    })
    l
    • 2
    • 5
  • j

    jasonkuhrt

    09/25/2019, 12:09 PM
    set the channel topic: https://github.com/prisma-labs/nexus
  • j

    Josef Henryson

    09/25/2019, 1:36 PM
    What is the best resource to learn how to write queries with prisma-client and/or nexus (see my last post above)? Anyone?
  • j

    Josef Henryson

    10/02/2019, 1:41 PM
    Has anyone implemented file upload with Apollo Server & Nexus? I am trying to add an upload resolver to my schema and use the Apollo scalar Upload type but I don’t know what kind of arg I should use. Anyone with an example?
    t
    • 2
    • 7
  • l

    lucid_frog

    10/06/2019, 4:18 PM
    hey there 👋 I’m having trouble with the
    nexus-prisma
    package, I’m following the get Started tutorial (graphql api part) and this line doesn’t seem to be working:
    Copy code
    import { makePrismaSchema, prismaObjectType } from 'nexus-prisma'
    I’ve also been looking at the nexus-prisma doc and these functions are being used however, when I do a full search on the repo, they are nowhere to be found, any idea?
    w
    • 2
    • 3
  • s

    Sullivan Senechal

    11/01/2019, 8:17 PM
    Hi here, I would like to use nexus with prisma1. I see I have to keep v0.3 in order to acheive that. My question is: Is it safe to use nexus-prisma with prisma1? I would like to avoid code repetition thanks to this tool, but I would not like to have bad (and unresolvable because of the version stuck) issues with it. Thanks!
    j
    w
    • 3
    • 10
  • j

    Jarvis Prestidge

    11/02/2019, 7:09 PM
    Is there a recommended way to validate input when using nexus-prisma? For example when we're exposing the auto-generated crud operations, how would one validate input in this scenario? i.e.
    Copy code
    t.crud.createOneUser({ alias: "signupUser" });
    I've scanned the issues section and there a couple of issues that don't provide an answer (https://github.com/prisma-labs/nexus/issues/177 + https://github.com/prisma-labs/nexus/issues/64).
    j
    • 2
    • 1
  • j

    Jarvis Prestidge

    11/02/2019, 7:16 PM
    Ideally using a well-loved input validation library such a class-validator or similar would be amazing to define DTOs and have those classes used to validate input, similar to the way NestJs recommends you accomplish this.
  • j

    Jarvis Prestidge

    11/04/2019, 2:51 PM
    🙏 for response above would be greatly appreciated,
    side note: is this the right place to ask these questions?
  • d

    David Blass

    11/05/2019, 5:23 PM
    Is there a way to automatically generate a default crud API using nexus-prisma for account specific data (i.e. User has a 1-m relationship with Posts, Photos, etc.) without requiring that the user be specified as part of each query in a connect block since we can get it from context?
  • a

    Andrew O.

    11/14/2019, 1:28 AM
    With Nexus how do I pass through a sub GraphQL that's not Prisma?
  • s

    Slackbot

    11/26/2019, 5:29 PM
    This message was deleted.
    a
    • 2
    • 1
  • d

    Darryl

    11/28/2019, 9:53 AM
    Hi, everyone. I'm trying to migrate my Prisma 1 (with nexus) app to Prisma 2 and I've come across a few issues. When writing queries in Prisma 1, I could just do this to expose these things to my API:
    Copy code
    t.prismaFields([
      "categories",
      "ingredients",
    ])
    Now, though, it looks like I should be able to just use the following:
    Copy code
    t.crud.categories()
    t.crud.ingredients()
    That said, if I do that I get the following:
    Copy code
    Missing type Category, did you forget to import a type to the root query?
    So, I define
    Category
    in
    /types
    (Like
    User
    and
    Post
    in the example). I get that this way, I can be explicit in what I want to expose but do I really have to manually create this? I have quite a few models and some of them are more complex with relations to others, containing Enums, etc. Do I need to manually set all of this up or am I missing something? I hope it's the latter. 🙂
12345...25Latest