[SOLVED] GraphQL and the nested strings?


#1

I am using the GraphQL API and I have an issue, the current GraphQL API does not support the nested string.

For example, I would like to search the PR with the label=“awaiting merge”. On the interface of Github, there is no problem but this is not the case with the GraphQL API.

query {
  search(query: """is:open is:pr repo:python/cpython review:approved status:success label="awaiting merge" """, type: ISSUE, first: 100) {
    issueCount
    edges {
      node {
        ... on PullRequest {
          number
          url
          title
          mergedBy {
            login
          }
        }
      }
    }
  }
}

You can see the example with a string block https://facebook.github.io/graphql/June2018/#example-fe73f

How can I do my query?

Have a nice day,

Thank you


#2

I found the solution, just use ‘"’ in the query variables but I thought to have tested this solution.
sorry :confused:


#3

I think the syntax requires a newline after the triple quotes. This query works:

query TestQuery {
  search(query: """
    is:open is:pr repo:python/cpython review:approved status:success label:"awaiting merge"
    """, type: ISSUE, first: 100) {
    issueCount
    edges {
      node {
        ... on PullRequest {
          number
          url
          title
          mergedBy {
            login
          }
        }
      }
    }
  }
}