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

    ambethia

    02/01/2017, 5:37 AM
    <!here|@here> I know I can filter records a user owns, like:
    Copy code
    query {
      allFamilies(filter: {
        owner: {
        	id: "ciymhiyl333740126m0n3gwc5"
        }
      }) {
        name
      }
    }
    and I can get the session user with:
    Copy code
    query {
      user {
        id
      }
    }
  • a

    ambethia

    02/01/2017, 5:38 AM
    Is there a way I can combine those into one query?
  • a

    ambethia

    02/01/2017, 6:23 AM
    Or do I just need to save the result of the user id query to reuse it? I can't seem to decide where the best place to do that is.
  • n

    nilan

    02/01/2017, 7:45 AM
    user
    also has a field, presumably called
    family
  • n

    nilan

    02/01/2017, 7:46 AM
    so you can do this
  • n

    nilan

    02/01/2017, 7:48 AM
    Copy code
    query {
      user {
        id
        family {
          name
        } 
      }
    }
  • n

    nilan

    02/01/2017, 8:17 AM
    hey @altern8tif 👋
  • n

    nilan

    02/01/2017, 8:23 AM
    hope that helps @ambethia
  • a

    altern8tif

    02/01/2017, 8:38 AM
    Hellooo
  • a

    altern8tif

    02/01/2017, 8:39 AM
    Just wondering... How difficult/easy is it to migrate off Graphcool?
  • a

    altern8tif

    02/01/2017, 8:40 AM
    I'm worried abt lock-in just in case Graphcool goes the way of Parse
    👍 1
  • a

    altern8tif

    02/01/2017, 8:41 AM
    Does Graphcool run on a NoSQL db?
  • n

    nilan

    02/01/2017, 8:55 AM
    no, it runs on AWS Aurora (more info here https://www.graph.cool/docs/faq/graphcool-technology-ul6ue9gait/)
  • n

    nilan

    02/01/2017, 8:56 AM
    you can export your data as JSON right now
  • n

    nilan

    02/01/2017, 8:56 AM
    as well as the GraphQL schema
  • n

    nilan

    02/01/2017, 8:57 AM
    other than Parse, Graphcool is based on GraphQL and we try to leverage the possibilities resulting from it being an open standard as much as possible simple smile
    👍 2
    🎉 1
  • a

    ambethia

    02/01/2017, 4:06 PM
    @nilan oh! So I can do
    Copy code
    query {
      user {
        id
        families {
          name
        } 
      }
    }
    I gotta start thinking in GraphQL!
  • n

    nilan

    02/01/2017, 4:06 PM
    right!
  • a

    ambethia

    02/01/2017, 4:06 PM
    Awesome!
  • a

    ambethia

    02/01/2017, 4:07 PM
    ty so much
  • n

    nilan

    02/01/2017, 4:07 PM
    Have you seen the playground in the Console?
  • n

    nilan

    02/01/2017, 4:07 PM
    there you can explore the possibilities 🙂
  • a

    ambethia

    02/01/2017, 4:07 PM
    Yeah, I've been using that, I was just thinking about it from the wrong direction.
  • n

    nilan

    02/01/2017, 4:07 PM
    I see!
  • n

    nilan

    02/01/2017, 4:08 PM
    it's basically a combination of those two: https://www.graph.cool/docs/faq/graphcool-session-user-goij0cooqu https://www.graph.cool/docs/reference/simple-api/traverse-the-graph-aihaeph5ip
  • a

    ambethia

    02/01/2017, 4:08 PM
    I was about to setup something to store the
    { user { id } }
    result in state for other queries.
  • a

    ambethia

    02/01/2017, 4:08 PM
    Yes exactly!
  • a

    ambethia

    02/01/2017, 4:08 PM
    Thanks
  • n

    nilan

    02/01/2017, 4:08 PM
    Well that's what you also can do
  • n

    nilan

    02/01/2017, 4:09 PM
    it's a good idea to store the currently logged user somehow
1...939495...637Latest