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

    kratam

    07/29/2018, 2:06 PM
    Let's say I have a
    posts
    query which is retrieved by an API call. The
    comments
    field for every
    post
    is retrieved by another API call, the requests are batched with dataloader. Is it possible to filter the returned
    posts
    based on the
    comments
    field (e.g. only return
    posts
    with
    comments
    )? My problem is that the
    comments
    field is only available after I returned the promise from the
    posts
    query. Is it possible to filter/transform the returned data after every related promises resolved?
    d
    • 2
    • 11
  • v

    vacom

    07/29/2018, 4:01 PM
    Hasura just release its engine open source something to consider and compare to Prisma. https://github.com/hasura/graphql-engine/blob/master/README.md
    d
    • 2
    • 1
  • l

    liquidautumn

    07/29/2018, 6:59 PM
    Hi, could anyone please help understanding how to implement data migrations with Prisma. For example, if we had enum field and refactored it into set of boolean fields, what is the Prisma-way to set booleans based on enum?
    l
    • 2
    • 3
  • a

    ajmakhl

    07/30/2018, 3:04 AM
    So, I have a question. I am starting a graphcool project and I keep getting this error Whoops. Looks like an internal server error. Please contact us from the Console (https://console.graph.cool) or via email (support@graph.cool) and include your Request ID: eu-west-1systemcjk7oph4s6dsa0147tnnsmqho Is graphcool like slowly dying? Do you recommend me to migrate to prisma?
    d
    • 2
    • 1
  • a

    abhiaiyer

    07/30/2018, 3:38 AM
    I think in general my recommendation is to migrate from graphcool to prisma
  • a

    abhiaiyer

    07/30/2018, 3:38 AM
    but, your existing project SHOULD work
  • a

    abhiaiyer

    07/30/2018, 3:38 AM
    so we should diagnose whats going on
  • a

    ajmakhl

    07/30/2018, 4:07 AM
    @abhiaiyeryeah i think i will just migrate. are there any examples on how to enable regular email and password authentication with prisma?
  • a

    abhiaiyer

    07/30/2018, 4:07 AM
    We wrote an example for auth here: https://github.com/prismagraphql/prisma/tree/master/examples/authentication
  • a

    abhiaiyer

    07/30/2018, 4:08 AM
    but if you need more help, DM me
  • a

    abhiaiyer

    07/30/2018, 4:08 AM
    ill help ya
  • a

    ajmakhl

    07/30/2018, 4:09 AM
    awesome. im going to try to do it myself. thanks!
  • a

    abhiaiyer

    07/30/2018, 4:09 AM
    np!
  • m

    matus.congrady

    07/30/2018, 8:58 AM
    Hello, let's say I have a Post type coming from prisma-datamodel. Then, in my application schema, I want to add a new field to this type (coming from different data-source). What's the best way to implement this? I was thinking about type-level resolver, but this would be very ineffective for multi-node queries (e.g. posts). Thanks!
  • m

    michieldewilde

    07/30/2018, 9:55 AM
    I'm running into the following error when trying to upgrade to prisma 1.12. So my frontend is sending the following query to my backend.
    Copy code
    query factoriesQuery($accountId: ID!) {
        factories(accountId: $accountId) {
          ...factoryFields
        }
      }
      
      fragment factoryFields on Factory {
        id
        name
        collections(orderBy: name_ASC) {
          …collectionFields
        }
        toys(orderBy: name_ASC) {
          …toyFields
        }
        categories(orderBy: name_ASC) {
          ...categoryFields
        }
      }
      
      fragment toyFields on Toy {
        id
        name
        category {
          ...categoryFields
        }
      }
      
      fragment categoryFields on Category {
        id
        name
      }
      
    fragment collectionFields on Collection {
        id
        name
        toys(orderBy: name_ASC) {
          …toyFields
        }
      }
      
       fragment toyFields on Toy {
        id
        name
        category {
          ...categoryFields
        }
      }
      
      fragment categoryFields on Category {
        id
        name
      }
    The backend is throwing the following error:
    There can be only one fragment named "categoryFields".,There can be only one fragment named “toyFields”.,There can be only one fragment named "categoryFields".
    I’m guessing that this has something to do with graphql-tools.
    d
    • 2
    • 2
  • m

    michieldewilde

    07/30/2018, 9:56 AM
    Thanks in advance for the help
  • s

    steven

    07/30/2018, 2:31 PM
    anyone able to point me to some documentation for creating a
    /status
    endpoint on a
    graphql-yoga
    project? I have one deployed in AWS and want to hook up a load balancer health check.
    d
    • 2
    • 1
  • l

    liamdanielduffy

    07/30/2018, 3:43 PM
    hey all, is anyone able to shed some light on how to successfully get a
    generated/prisma.graphql
    file after running
    prisma deploy
    ?
  • l

    liamdanielduffy

    07/30/2018, 3:44 PM
    I have my hooks setup in my
    prisma.yml
    file to run
    graphql get-schema -p <my_project>
  • l

    liamdanielduffy

    07/30/2018, 3:44 PM
    and they run in the command line successfully post deployment, with a little green check appearing next to the command once its done running
  • l

    liamdanielduffy

    07/30/2018, 3:44 PM
    but there's no
    prisma.graphql
    file present in my directory when the command finishes
  • j

    james h

    07/30/2018, 4:17 PM
    hey all im trying to setup prisma server using docker stack, and i want to use secrets for the configuration. It's not clear if/how I can do that, the configuration yaml seems to be passed as an environment variable. Is there a way I can have it use a file instead?
    d
    • 2
    • 20
  • j

    james h

    07/30/2018, 4:17 PM
    the documentation doesnt seem to be very thorough in this regard either.
  • j

    Joby Joseph

    07/30/2018, 4:29 PM
    Hi everyone! Is there a bug channel to report bugs?
  • j

    Joby Joseph

    07/30/2018, 4:40 PM
    I'm getting an error trying to share from playground:
  • j

    Joby Joseph

    07/30/2018, 4:40 PM
    Copy code
    "errors": [
        {
          "locations": [
            {
              "line": 2,
              "column": 3
            }
          ],
          "path": [
            "addSession"
          ],
          "code": 5008,
          "message": "software.amazon.awssdk.services.lambda.model.ResourceNotFoundException: Function not found: arn:aws:lambda:eu-west-1:484631947980:function:cj81hi46q03c30196uxaswrz2-add-session (Service: null; Status Code: 404; Error Code: ResourceNotFoundException; Request ID: 8746f037-9414-11e8-9b33-bd3c86f8b4fe)",
          "requestId": "eu-west-1:simple:cjk8hcyms0ntw0130a8siwya3"
        }
      ]
    d
    • 2
    • 2
  • j

    Joby Joseph

    07/30/2018, 4:40 PM
    Looks like your lambda function isn't up?
  • c

    chrisbull

    07/30/2018, 8:43 PM
    🤷‍♂️ Hello fellow Prisma fans…. I’m struggling to find any help or info with dealing with Geometry / Geographical Data / Coordinates, etc instructions with Prisma. To better explain, my client has an existing database that I’m migrating over to use Prisma. It’s a Postgres db with Postgis features activated, which adds coordinate data and allows for sql queries with coordinate points . When I run prisma introspect, it successfully reads the tables, but comments out the value
    geometry
    stating
    # Type 'USER-DEFINED' is not yet supported.
    . Here is the SQL query and expected returned value of the column.
    Copy code
    SELECT ST_AsGeoJSON(logs.geometry) FROM logs
    
    { type: "LineString", coordinates: [[-79.895893,40.445344],[-79.895914,40.44529]] }
    if I don’t use
    ST_AsGeoJSON
    I get a value with only A-Z0-9 characters, such as
    010200000002000000CE3637A627FD...
    That said, when using Prisma, I’d like for Prisma to extract the data by wrapping the query using
    ST_AsGeoJSON
    so that it returns the object
    geometry: {type: String, coordinates:[[Float]]}
    ... instead of
    geometry: String
    . I’m also trying to do this easily, with as little of ‘custom’ code as possible. Does anyone have a solution or workaround that would solve my dilemma? 1. Do I need to need to pull the String and then using JS convert it on the frontend to the object? 2. Or is there a way to get Prisma to pass the query wrapper (eg
    ST_AsGeoJSON
    ) so that it returns the object automatically? 3. What do I need to use as
    type Geometry { type: String, coordinates: [[Float]] }
    to get this to work? Right now it’s screaming at me as it doesn’t like the
    [[Float]]
    and that Geometry doesn’t have any relationships in the database. Any help is greatly appreciated! Thank you
  • f

    faure

    07/30/2018, 9:15 PM
    Hello, I'm planning on using prisma deploy with a service hosted in fargate. AFAIK I would only make changes to the graphql file, which specifies the datamodel. Seems simple enough. However, I'm concerned with the safety of my data. How exactly does prisma resolve changes in the datamodel? If I add a new field, does it create blank entries? I'd like to read more about this topic.
  • c

    chrisbull

    07/30/2018, 9:34 PM
    @faure: I’m new here. But as im asking for help above, I’m happy to help with what little I know. - To answer your question, when you do a change to your schema and then run
    prisma deploy
    if you’ve added any fields to your type object, it generates a new column in your table with a default value of
    null
    . If you want to set a default value use
    { someValue: String! @default(value: 'somedefault')
    . This is assuming you are not using an existing database and that “migrations: true” in your docker-compose.yml. If you are using an existing database migrations will be set to false (this is to protect your database from any changes to the existing tables).
    🙌 2
1...919293...637Latest