I am new to graphql and I need a help to send graphql query with fragments for my android app. Below is the query format accepted by network.
query{
  user(ident:"JohnDoe"){
    myStory{
      description,
    placements(first:3){
      edges{
        node{
          mediaItemType
          mediaItem {
            ...VideoFragment
            ...PhotoFragment
          }
        }
      }
    }
    }
  }
}
fragment VideoFragment on Video {
    videoHTML
}
fragment PhotoFragment on Photo {
    url(size:10)
}
Any help appreciated!!
This likely depends on the server implementation of GraphQL. GraphQL does not define the medium, which leaves this question as being somewhat broad. Since express-graphql is so common, I'll make a guess that you may be using that. If that's true, you can query it over HTTP with more details outlined on the documentation for that project. If that happens to not be the case, you'll need to do some more digging.
I got it working by adding it in strings.xml as below. make sure there are NO extra spaces.
<string name="graphiql_detail_search">
{
  user(ident: "JohnDoe") {
    myStory {
      description
      placements(first: 3) {
        edges {
          node {
            mediaItemType
            mediaItem {
              ...VideoFragment
              ...PhotoFragment
            }
          }
        }
      }
    }
  }
}
fragment VideoFragment on Video {
  videoHTML
}
fragment PhotoFragment on Photo {
  url(size: 10)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With