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

    m.b.iqbal

    02/28/2017, 7:27 AM
    What is the maximum amount of data that i can send with a post request?
  • m

    m.b.iqbal

    02/28/2017, 7:28 AM
    I want to fetch the posts of the people i follow and the only way i can think of is by first fetching the following people ids and then filter posts using user: {id_in: [<array of followings ids>]}
  • a

    alexgaspar

    02/28/2017, 8:32 AM
    Copy code
    viewer {
       following {
          (edge/node if needed)
          allPosts {
             (edge/node if needed)
              title
              ....
          }
        }
    }
  • a

    alexgaspar

    02/28/2017, 8:33 AM
    @m.b.iqbal: ^ like this?
  • a

    alexgaspar

    02/28/2017, 8:35 AM
    You shouldn’t need multiple request with graphql, that’s one of the reason it exists
    😄 1
  • m

    m.b.iqbal

    02/28/2017, 8:48 AM
    What do you mean by this “(edge/node if needed)"
  • m

    m.b.iqbal

    02/28/2017, 8:51 AM
    I used this this will bring back all the users that i follow and their posts. I don't really need the followings if they haven't shared anything.
    Untitled.js
  • a

    alexgaspar

    02/28/2017, 9:04 AM
    Just remove them after the queries
  • a

    alexgaspar

    02/28/2017, 9:05 AM
    Like this you’ve what you need right?
  • a

    alexgaspar

    02/28/2017, 9:05 AM
    (edge/node was if you were using relay)
  • m

    m.b.iqbal

    02/28/2017, 9:10 AM
    actually no. I need posts in a feed like manner. Consider i just want to fetch 30 latest posts that were shared by people i follow.
  • m

    m.b.iqbal

    02/28/2017, 9:11 AM
    i want something that returns one array of posts created by people who i follow.
  • a

    alexgaspar

    02/28/2017, 9:12 AM
    I think in that case you better have a field feed on user
  • a

    alexgaspar

    02/28/2017, 9:12 AM
    that would do all that
  • m

    m.b.iqbal

    02/28/2017, 9:14 AM
    i have a relation user > following > posts How can i have a field that related to these posts
  • a

    alexgaspar

    02/28/2017, 9:17 AM
    I don’t use graph.cool so I don’t really know, but i think you can have custom code right?
  • a

    alexgaspar

    02/28/2017, 9:17 AM
    and in your case it just mapped to a sql query
  • m

    m.b.iqbal

    02/28/2017, 9:18 AM
    unfortunately you can't
  • m

    m.b.iqbal

    02/28/2017, 9:18 AM
    but thanks for your help anyways
  • a

    alexgaspar

    02/28/2017, 9:19 AM
    Oh I thought you could use something like aws lambda
  • m

    m.b.iqbal

    02/28/2017, 9:19 AM
    yeah thats after you create/update a record
  • m

    m.b.iqbal

    02/28/2017, 9:20 AM
    thats the only way you can invoke code(please correct me if i am wrong)
  • n

    nilan

    02/28/2017, 9:27 AM
    @m.b.iqbal. you can use this query:
    Copy code
    query {
      allPosts(filter: {
        author: {
          followedBy_some: {
            id: "id
          }
        }
      }
    }
  • m

    m.b.iqbal

    02/28/2017, 9:41 AM
    Thanks a lot @nilan. Doesnt some mean that its possible to miss a few records using this query?
  • m

    m.b.iqbal

    02/28/2017, 9:42 AM
    or is it iron clad and will return all records for which this user is a follower
  • n

    nilan

    02/28/2017, 9:42 AM
    Well, this will return all posts of authors the user is following. No lost records 😉
  • m

    m.b.iqbal

    02/28/2017, 9:43 AM
    ah
  • m

    m.b.iqbal

    02/28/2017, 9:43 AM
    finally
  • m

    m.b.iqbal

    02/28/2017, 9:43 AM
    thanks a lot nilan
    👍 1
  • a

    artyom

    02/28/2017, 9:57 AM
    @jimmy @rock-n-node 👋 hello!
1...112113114...637Latest