https://www.prisma.io/ logo
Join Slack
Powered by
# prisma-whats-new
  • a

    Andrii Los

    01/24/2018, 6:29 PM
    Hey guys. One question. Who is here working with WebStorm? You are probably using graphql plugin. Question is, I added graphcool simplified schema renaming it to
    schema.graphqls
    and gave it to
    graphql.config.json
    and it actually supported via plugin finally. But problem is that simplified schema is too simple, so my queries are still half red, but Relay schema generation is Relay schema not Apollo one, so still, all my queries are red. Any chances to get all those mutations info etc somehow automatically? I mean the same schema we have in schema slider menu at the right.
    n
    • 2
    • 6
  • d

    develomark

    01/24/2018, 7:24 PM
    🍾parrotwave2prisma Hi all just released a plugin for
    graphql-cli
    to generate fragments from your schemas to use in queries. https://github.com/develomark/graphql-cli-generate-fragments. To install
    npm i graphql-cli-generate-fragments
    . Slots right into the Prisma/GC workflow. Enjoy!
    👌 2
    🚀 1
    🦜 1
    🎉 2
  • b

    bradrich

    01/24/2018, 7:35 PM
    Hello all. I have a question about aggregation. Overview: I have a schema for Bills. Within a Bill are Payments. I want to populate a property on Bill called
    averagePaymentAmount
    . Can someone please help me with this? Google has failed me.
  • h

    harrisrobin

    01/24/2018, 7:41 PM
    @bradrich Prisma does not support
    avg
    aggregation yet, only
    count
    . They are working on it
  • h

    harrisrobin

    01/24/2018, 7:42 PM
    you will have to do this yourself via a custom resolver
    b
    • 2
    • 24
  • h

    harrisrobin

    01/24/2018, 7:42 PM
    on another note, if you end up doing that please let me know the performance of that
  • j

    juicycleff

    01/24/2018, 8:18 PM
    Ok I asked this ealier. Does prisma support @live or @defer directives?
    n
    • 2
    • 2
  • a

    ajmakhl

    01/24/2018, 8:39 PM
    I think the apollo client is freezing my react native app. I cannot press any buttons .. not even navigation tabs.. this was working fine yesterday and I did not change my code.
  • a

    ajmakhl

    01/24/2018, 8:39 PM
    is this happening to anyone else?
  • a

    ajmakhl

    01/24/2018, 8:46 PM
    seems like this.props.LoggedInUserQuery is frozen at true
  • m

    matic

    01/24/2018, 9:13 PM
    Hey, I have an issue with my permissions, would love to get some help if you spot a bug, tried almost everything 😄 My schema looks like this:
    Copy code
    type TicketScan @model {
      id: ID! @isUnique
      createdAt: DateTime!
      updatedAt: DateTime!
    
      ticket: Ticket! @relation(name: "TicketScanOnTicket")
      event: ModeratedEvent! @relation(name: "ModeratedEventScanedTicket")
    }
    
    type ModeratedEvent @model {
      id: ID! @isUnique
      createdAt: DateTime!
      updatedAt: DateTime!
    
      user: User! @relation(name: "UserModeratedEvent")
      event: Event! @relation(name: "EventModerator")
      scannedTickets: [TicketScan!]! @relation(name: "ModeratedEventScanedTicket")
    }
    
    type Event @model {
      id: ID! @isUnique
      createdAt: DateTime!
      updatedAt: DateTime!
    
      name: String!
      description: String!
      speaker: String!
      period: Int!
      location: String!
      numberOfAvailableTickets: Int!
    
      thumbnail: String!
      picture: String!
    
      tickets: [Ticket!]! @relation(name: "EventTicket")
      moderators: [ModeratedEvent!]! @relation(name: "EventModerator")
      admins: [AdministeredEvent!]! @relation(name: "EventAdministrator")
    }
    
    type Ticket @model {
      id: ID! @isUnique
      createdAt: DateTime!
      updatedAt: DateTime!
    
      event: Event! @relation(name: "EventTicket")
      attendee: Customer! @relation(name: "EventAttendee")
    
      bill: [TicketBill!]! @relation(name: "TicketBillOnTicket")
      scan: TicketScan @relation(name: "TicketScanOnTicket")
    }
    
    type User @model {
      id: ID! @isUnique
      createdAt: DateTime!
      updatedAt: DateTime!
    
      email: String! @isUnique
      password: String!
    
      role: UserRole @defaultValue(value: BLOCKED)
    
      administeredEvents: [AdministeredEvent!]! @relation(name: "UserAdministeredEvent")
      moderatedEvents: [ModeratedEvent!]! @relation(name: "UserModeratedEvent")
    }
    Permissions :
    Copy code
    - operation: TicketScan.create
        authenticated: true
        query: permissions/scan.graphql
    Copy code
    query permitScan($user_id: ID!, $input_eventId: ID!, $input_ticketId: ID!) {
       SomeModeratedEventExists(filter: {
          id: $input_eventId,
          user: {
             id: $user_id
          },
          event: {
             tickets_some: {
                id: $input_ticketId,
                scan: null
             }
          }
      })
    }
    Works if this permission is set to allow all, and I also can find an event matching the fields in
    Permissions tester
    .
    m
    • 2
    • 5
  • h

    hari mohan

    01/24/2018, 9:20 PM
    hello I want write query wishpoint(parent, { name }, ctx, info) { console.log(id); // const id = getUserId(ctx) return ctx.db.query.wishpoint({ where: { username: name } }, info) }, in where user how can search a Wildcards as like => where{ username LIKE name }
  • m

    matic

    01/24/2018, 9:22 PM
    you can use
    query.wishpoints
    which allows you to use filter queries (not just
    id
    filter query)
  • h

    hari mohan

    01/24/2018, 9:25 PM
    okay but how use wildcard search => WHERE UserName LIKE 'a%'
  • m

    matic

    01/24/2018, 9:27 PM
    you have a filter
    name_contains
    for example. Check out your schema docs in playground (web console, green notch on the right) 🙂
  • h

    hari mohan

    01/24/2018, 9:28 PM
    okay @matic Thankyou
  • m

    matic

    01/24/2018, 9:37 PM
    no problem 🙂
  • m

    MK

    01/24/2018, 10:59 PM
    Not supporting MongoDB is such a disappointment
    j
    h
    • 3
    • 12
  • d

    donedgardo

    01/24/2018, 11:26 PM
    Is there a way to find your deployed target in the cloud other than
    .graphcoolrc
    ?
    a
    • 2
    • 2
  • e

    elmir

    01/24/2018, 11:29 PM
    Anyone have any updates on deployment issues?
  • v

    veksen

    01/25/2018, 3:41 AM
    I've spent the last hour trying to get this error, and I just don't. I have what should a simple relation: 1 to 1 User/Profile, and trying to create a profile for an already existing user inside the playground:
    Copy code
    mutation {
      createProfile(userId: "cjcs1tv4k1ga60134mh799k7r") {
        id
        firstName
        lastName
      }
    }
    getting me the following error:
    Copy code
    "Variable \"$_where\" got invalid value {\"user\":{\"id\":\"cjcs1tv4k1ga60134mh799k7r\"}}; Field \"user\" is not defined by type UserWhereInput."
    the mutation itself is defined and copied like the Link/Vote from the Howtographql.com tutorials (hackernews clone):
    Copy code
    type Mutation {
      ...
      vote(linkId: ID!): Vote
      createProfile(userId: ID!): Profile
    }
    I know this might not be the best place to ask about this, if so, please direct me to a better place 🙂
    s
    • 2
    • 3
  • a

    agartha

    01/25/2018, 3:46 AM
    Please check the SCHEMA tab in the playground carefully for the correct mutation arguments
  • v

    veksen

    01/25/2018, 3:48 AM
  • v

    veksen

    01/25/2018, 3:49 AM
    is this my misunderstanding that there is a difference between an ID, and a string that is an ID?
  • a

    agartha

    01/25/2018, 3:52 AM
    Hmmm... no that seems fine actually... 🙃
    v
    • 2
    • 2
  • n

    Nick Luger

    01/25/2018, 4:20 AM
    Regarding: software.amazon.awssdk.services.lCodeStorageExceededException. I can't deploy any schema changes etc. at all. Is this normal or should this error affect only hosted functions? As i do not make any changes to hosted functions, only schema changes.
  • v

    varun

    01/25/2018, 5:54 AM
    how to use isDeleted: Boolean! key in mutation any example please share with me
  • g

    Goutham

    01/25/2018, 6:09 AM
    Global ✖️ software.amazon.awssdk.services.lambda.model.CodeStorageExceededException: Code storage limit exceeded. (Service: null; Status Code: 400; Error Code: CodeStorageExceededException; Request ID: a4a4e72f-0128-11e8-a209-4f094570d91a)
    n
    • 2
    • 13
  • v

    varun

    01/25/2018, 7:04 AM
    hii all how to use isDeleted: Boolean! key in mutation any example please share with me
    n
    • 2
    • 2
  • t

    trjstewart

    01/25/2018, 7:13 AM
    Anyone have experience with using chromeless to download and access files? I have it working with the download triggering but am at a loss as to how I can set the download directroy, specifically to then access / read it back from a remote session.
1...542543544...637Latest