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

    Julián Álvarez

    03/13/2019, 5:50 AM
    Which is the best way to compile a yoga server with prisma and nexus, I am having these error
  • j

    Julián Álvarez

    03/13/2019, 5:51 AM
    GraphQL Nexus: Unable to find file or module /Users/julian/tsprojects/new-inspector/backend/dist/src/types.ts, skipping Missing required typegen import: types
  • j

    Julián Álvarez

    03/13/2019, 5:51 AM
    and is because the index.js is like this in the dist folder
  • j

    Julián Álvarez

    03/13/2019, 5:51 AM
    w
    • 2
    • 1
  • j

    Julián Álvarez

    03/13/2019, 5:52 AM
    but the generated file is a .js now
  • j

    Julián Álvarez

    03/13/2019, 5:52 AM
    the original index.ts is like this
  • j

    Julián Álvarez

    03/13/2019, 5:53 AM
    -.ts
  • c

    Chris Fuller

    03/13/2019, 10:08 AM
    Could we have a public nexus channel?
    w
    • 2
    • 2
  • r

    Rinat

    03/13/2019, 10:30 AM
    Hello Are there any after/before operation hooks in prisma?
  • e

    Emil

    03/13/2019, 10:59 AM
    Hello, deployed a fresh database on mongo today and noticed, that the generated schema has on the list query fields the return type
    [User]!
    without ! behind the User type. I thought it has to be
    [User!]!
    (note the two exclamation marks). When did this change happen (can’t find it on the releases on github) and is this intended behaviour?
  • p

    Petr Homoky

    03/13/2019, 12:58 PM
    Hi guys, just quick question: What do prefer for combination yoga with typescript + prisma? Nexus or graphqlgen?
    m
    • 2
    • 2
  • n

    Navneet Garg

    03/13/2019, 1:22 PM
    Is this support mysql views and stored procedure?
  • k

    kitze

    03/13/2019, 2:01 PM
    Anyone else has a problem with
    PRISMA_MANAGEMENT_API_SECRET
    after updating the cli? I have no idea what should be the value for it...
    d
    • 2
    • 8
  • b

    btotharye

    03/13/2019, 2:45 PM
    can anyone tell me what the right formatting would be for a prisma type that references other objects? Below is an example of what I'm trying to do: datamodel.graphql:
    Copy code
    type Prey {
      id: ID! @id
      type: String!
      size: String!
      weight: Int
      owner: User! @relation(link: INLINE)
    }
    
    type Feed {
      id: ID! @id
      prey: Prey! @relation(link: INLINE)
      date: DateTime!
      notes: String
      snake: Snake!
    }
    Then I'm using yoga and prisma together and create the resolver like this but it isn't working atm:
    Copy code
    createFeed(
        prey: PreyWhereUniqueInput!
        date: DateTime
        notes: String
        snake: SnakeWhereUniqueInput!
      ): Feed!
    I tried doing something like this from prisma playground:
    Copy code
    mutation createFeed{
      createFeed(
        prey: {id: "5c890827be07770007e6a914"}
        snake: {id: "5c86ed54be07770007e6a90e"}
        date: "2019-03-13"
      ){id date }
    }
    But that gives me
    "Cannot return null for non-nullable field Mutation.createFeed."
    isn't there some way to do a connect for the prey and snake id or something I just can't remember how to do it
  • b

    btotharye

    03/13/2019, 2:46 PM
    typical mutations work fine that don't have relationships like this for example:
    Copy code
    createPrey(type: String!, weight: Int!, size: String!): Prey!
  • b

    btotharye

    03/13/2019, 2:47 PM
    I had all this working before with postgres but when I changed over to mongo I think I lost some of that work and I'm not sure if it would even be the same
  • j

    Jidé

    03/13/2019, 2:59 PM
    I’m experimenting something weird with demo servers right now: I can’t update/insert long strings or json, though it used to work. Possible regression ?
    d
    • 2
    • 2
  • e

    ezeikel

    03/13/2019, 4:03 PM
    Using
    OR
    inside of
    where
    doesn't seem to be working. I keep getting back
    Copy code
    Error: Variable '$where' expected value of type 'UserWhereInput' but got: {"OR":[]}. Reason: 'OR' Field 'OR' is not defined in the input type 'UserWhereInput'. (line 1, column 8):
    query ($where: UserWhereInput) {
    typeDefs:
    Copy code
    type Query {
      users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, first: Int ): [User!]!
      user(id: ID!): User
    }
    Resolver:
    Copy code
    users: (_, { where }, ctx, info) => {
        return ctx.prisma.users({ where }, info);
      }
    Query in Playground:
    Copy code
    {
      users(
        where: {
          OR: [{ username_contains: "ross" }, { firstName_contains: "rick" }]
        }
      ) {
        id
        username
      }
    }
    u
    • 2
    • 7
  • e

    ezeikel

    03/13/2019, 4:04 PM
    If i remove the
    OR
    and just query on one field it works as expected, just can't seem to combine them
  • m

    Mustafa

    03/13/2019, 4:49 PM
    I am using GraphQL-yoga and have implemented an increment. Does anyone know a better way to handle this to avoid race conditions?
    Mutation.js
  • r

    Robert

    03/13/2019, 5:14 PM
    I have created a demo app with a React front end and a GraphQL-Yoga backend using the free Prisma servers as the DB. I need to share the demo with others (they’ve requested via zip file) —> what do they need to do to be able to use the demo app? Do they need to
    prisma generate
    and
    prisma deploy
    on their local machine? Will they be able to access my DB without authentication at their end? Thanks for any help!
    h
    • 2
    • 1
  • j

    jdoyle112

    03/13/2019, 6:29 PM
    Does anyone know if it’s possible to create custom input types in your schema declaration for a yoga server? I have a mutation and want to pass a plain object through but I’m getting an error during schema validation
    ✅ 1
    b
    • 2
    • 3
  • j

    jdoyle112

    03/13/2019, 6:31 PM
    Nvm figured it out. When I was declaring the input type object, it needs to be ‘input’ instead of ‘type’
  • r

    Robert

    03/13/2019, 8:06 PM
    I’m trying to do a simple delete of a ‘Job’ with this resolver in Mutations:
    Copy code
    deleteJob: async (parent, {id}) => {
          return await prisma.deleteJob({where: {id}})
        }
    but I get the following error
    Copy code
    Variable '$where' expected value of type 'JobWhereUniqueInput!' but got: {"where":{"id":"cjt7klf3q5lyc0b79ayuloctr"}}. Reason: 'where' Field 'where' is not defined in the input type 'JobWhereUniqueInput'. (line 1, column 11):
    mutation ($where: JobWhereUniqueInput!) {
    What am I doing wrong?
  • r

    Robert

    03/13/2019, 8:08 PM
    Oh, I see, it’s
    Copy code
    deleteJob: async (parent, {id}) => {
          return await prisma.deleteJob({ id})
        }
      },
  • r

    Robert

    03/13/2019, 8:10 PM
    But then this link https://www.prisma.io/tutorials/a-guide-to-common-resolver-patterns-ct08 seems to be showing bad examples?
    Copy code
    Add a delete resolver to Mutation part of src/index.js
    
    delete(parent, { id }, ctx, info) {
      return ctx.db.mutation.deletePost(
      {
        where: { id }
      },
        info
      );
    }
    h
    • 2
    • 1
  • w

    Wendell Misiedjan

    03/13/2019, 10:01 PM
    Is dit possible to directly query with a 'now' date / time?
  • w

    Wendell Misiedjan

    03/13/2019, 10:02 PM
    e.g.
    Copy code
    where: {
     startsAt_gt: now()
    }
    Or is this something that I'd manually have to configure in my prisma server?
    h
    h
    • 3
    • 4
  • j

    jblevins

    03/13/2019, 10:26 PM
    I am getting an error message on my where argument I added to a query, and I'm not exactly understanding what it means, can someone help me with this? Here is the repository for my project: https://github.com/jblevins1991/Nexus-Example
    h
    • 2
    • 1
  • j

    jblevins

    03/13/2019, 10:26 PM
    Here is the error
1...234235236...637Latest