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

    ramin

    01/21/2019, 12:52 PM
    😁hey everybody did upgraded graphql-yoga to graphql-server 2.0 (version 2) ?
    e
    • 2
    • 1
  • r

    rem

    01/21/2019, 1:28 PM
    I'm trying to run some fairly straight forward tests against my graphql backend, but though queries work, mutations fail with
    Project not found: 'backend$test'
    - this is a snippet of the code (again, queries work just fine) https://git.io/fhzoX - anyone seen this kind of error (or know of good testing patterns - without mocks)
    h
    • 2
    • 12
  • r

    rem

    01/21/2019, 1:31 PM
    huh, actually, queries don't work - they fail when they try to hit the database with the same error.
  • a

    andykay

    01/21/2019, 1:52 PM
    I can't seem to get
    items
    to load with this query:
    Copy code
    course(where: {id: "cjqqp8g9z00xx0a06kchfp119"}) {
        id
        name
        units {
          id
          name
          items {
            id
            name
          }
        }
      }
    }
  • a

    andykay

    01/21/2019, 1:53 PM
    it loads them in the introspection playground but not my api one. In my api I'm using
    forwardTo
    w
    • 2
    • 28
  • b

    Biel Simon

    01/21/2019, 3:02 PM
    Are local deployments also rate limited?
    d
    m
    • 3
    • 47
  • j

    jdoyle112

    01/21/2019, 4:25 PM
    Has anyone in here had a problem with subscriptions? I’m using react + apollo and I’m receiving updates on my frontend about 50% of the time. I’ve been messing around with it for a while and can’t seem to get it 100% working.
  • r

    rem

    01/21/2019, 4:57 PM
    Got a bit of noob question: I'm running mutations that add nested data via
    { create: { ... }
    or
    { connect: { ... } }
    and I can see the records in my postgres database (in the tables starting with _), but when I query across data relations, it never comes back - nothing more complicated than this example: https://www.prisma.io/docs/prisma-graphql-api/reference/queries-qwe1/#querying-data-across-relations
    m
    h
    • 3
    • 12
  • r

    rem

    01/21/2019, 4:58 PM
    Question being: could I be missing something obvious?
  • r

    rem

    01/21/2019, 5:00 PM
    Like do I need to turn something on for Prisma to resolve queries across tables?
  • t

    tej

    01/21/2019, 5:01 PM
    Hello. Does
    graphqlgen
    support `union`s?
  • k

    kbpsystem

    01/21/2019, 5:11 PM
    👋
    👋 2
  • c

    CCBCodeMonkey

    01/21/2019, 5:38 PM
    hey, I am trying to figure out a way to do something... not sure if it is possible
  • c

    CCBCodeMonkey

    01/21/2019, 5:39 PM
    basically if I have an object like
    Post
    , and it has a sub object like
    Comment
    ... and
    Comment
    has an
    id
    and I want to add some data to
    Comment
    in the resolver where the data doesn't come from prisma
  • c

    CCBCodeMonkey

    01/21/2019, 5:39 PM
    I can fetch the data from my other source by the
    id
    of the comment, in my comment resolver
  • c

    CCBCodeMonkey

    01/21/2019, 5:40 PM
    the problem is the
    id
    is only there if the user queries for
    id
    in the original query, if they don't query for
    id
    I don't know how to look up the rest of the data..
  • c

    CCBCodeMonkey

    01/21/2019, 5:41 PM
    basically in my comment resolver, if the user originally queried for id, the id is there and I can add the other props, but if not, the id is undefined and I have no way of looking up the other props... and no way to know which
    Comment
    they are referencing to go back to prisma and get the
    id
  • c

    CCBCodeMonkey

    01/21/2019, 5:48 PM
    hard to explain what I am asking, trying to figure out how to better word it...
  • c

    CCBCodeMonkey

    01/21/2019, 5:49 PM
    the only thing I can figure is basically starting at the top of the resolver chain and completely ignoring their query and fetching everything... but that seems very imperformant
  • r

    rem

    01/21/2019, 5:54 PM
    @CCBCodeMonkey not sure I can help, but if you're able to share your resolver for the Comment type, it might help?
  • c

    CCBCodeMonkey

    01/21/2019, 5:55 PM
    I kind of made of that scenario because my schema and resolvers are too complext to post lol
  • c

    CCBCodeMonkey

    01/21/2019, 5:55 PM
    trying to break it down to the simplest way I can explain
    h
    • 2
    • 23
  • c

    CCBCodeMonkey

    01/21/2019, 5:56 PM
    im just saying, I have a parent resolver, and a child resolver, and in the child resolver I want to add some props that come from outside prisma, but I have no way of looking them up unless the parent resolver passes in some sort of ID to the child resolver
  • c

    CCBCodeMonkey

    01/21/2019, 5:56 PM
    like I have no reference to the prisma object, just the fields it returned
  • r

    rem

    01/21/2019, 6:21 PM
    Does
    prisma.user(…)
    do any caching? I'm starting to add relation resolvers in my
    User
    type, but I'm repeating
    prisma.user(…).<relation>
    throughout my
    /Types/User.js
    resolver. Just wary that if there's no caching, it could be running the same query against the user table many times…
    h
    • 2
    • 10
  • p

    pancake

    01/21/2019, 6:54 PM
    hey friends, I’m hoping for some good advice on nested queries. Supposing I have a query
    getClientUser( data: clientUserRetrievalArgs): ResponsePayload
    where ResponsePayload is defined as ‘{ token, clientUser }’. token is not represented in the data store, clientUser is. Any advice on how to ensure that nested queries of clientUser data from info are correctly passed?
  • r

    randolphpark

    01/22/2019, 12:31 AM
    Hi, I got to an issue with after introspecting existing Postgres DB. (https://github.com/prisma/prisma/issues/2466)
    Copy code
    # Type 'ARRAY' is not yet supported.
    I realise it is in the feature request, and it is not listed in roadmap. Dose it mean there would not be any update soon(couple of months)? Thanks in advance.
  • w

    warchantua

    01/22/2019, 9:54 AM
    How to modularize schema.graphql definition and still be able to feed it to
    graphqlgen
    ?
  • s

    serum

    01/22/2019, 12:06 PM
    I'm trying to implement an invite-system, where each invite has an expiration-date, and a status that tells me if the invite is still pending, or already expired. right now, I'm computing the value for the status field in my custom resolver based on the expiration-date, which works fine, but I'd rather like it to update the status in the prisma backend based on a timer. how'd I go about doing this? or is this maybe not recommended?
  • m

    mikedklein

    01/22/2019, 12:22 PM
    @serum I did something similar but not as exact. Basically I used a serverless function to call a query endpoint and then update the needed records based on the results of the query. Obviously this ended up meaning some could be exipred for a little while waiting for the function to run. Why not just add an expiry date in the backend?
    s
    • 2
    • 4
1...193194195...637Latest