Graphql-flutter: Union types query

Created on 20 Aug 2019  路  3Comments  路  Source: zino-app/graphql-flutter

Hi, first of all thanks for this amazing library.

I don't know if this is the correct place to put this but here i go:

I just started to creating an app consuming a third party graphQL API and now i'm facing the issue that i have to do the following query:

query Following(
  $isFollowing: Boolean = true
  $hasReplies: Boolean = false
  $activityType: ActivityType
  $page: Int
) {
  Page(page: $page, perPage: 10) {
    pageInfo {
      total
      perPage
      currentPage
      lastPage
      hasNextPage
    }
    activities(
      isFollowing: $isFollowing
      type: $activityType
      hasRepliesOrTypeText: $hasReplies
      type_in: [TEXT, ANIME_LIST, MANGA_LIST]
      sort: ID_DESC
    ) {
      ... on TextActivity {
        id
        userId
        type
        replyCount
        text
        createdAt
      }
      ... on ListActivity {
        id
        userId
        type
        status
        progress
        replyCount
        createdAt
        media {
          id
          type
          status
          isAdult
          title {
            userPreferred
          }
          coverImage {
            large
          }
        }
      }
    }
  }
}

I know that this library do not support fragments but still you know if there is another way to do this query with this library? I'm always receiving totalItems but an empty array of activities

Regards ;)

docs & examples help wanted investigate question

All 3 comments

Hi. I am just a user of this lib. Where does it say fragments are not supported. I do use fragments and it works fine. I also see them used in the example

:O then my bad i didn't found that example. I just searched fragments on issues and i got this issue https://github.com/zino-app/graphql-flutter/issues/113 so i thought it was not implemented since i didn't found any other related issue.

Okey then i close it, then for sure my error is because i did something wrong ;)

Thanks :)

@javi11 no problem. we are all learning through struggling :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sjmcdowall picture sjmcdowall  路  4Comments

rullyalves picture rullyalves  路  4Comments

jomag picture jomag  路  3Comments

thanhbinh84 picture thanhbinh84  路  4Comments

juicycleff picture juicycleff  路  4Comments