postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.87k stars 841 forks source link

Graphql dynamic variables usage in POSTMAN #2584

Closed sudheerj closed 7 years ago

sudheerj commented 7 years ago

As per POC on Graphql language I'm trying to test various types of queries in POSTMAN.But I didn't find the way to add below dynamic queries in POSTMAN.If it is not supported by POSTMAN then how can we build local graphiql with our own schema.

Example,

query GetAccounts($filter: AccountsFilter) {
accounts(filter: $filter) {
 account_name
}
}
{
  "filter": {
    "region": "APAC",
    "code": {"in": [ "HK1", "SG1" ]},
    "account_number": {"nin": [ "1" ]}
  }
}
sdnts commented 7 years ago

@sudheerj GraphQL queries aren't supported right now, but we've been thinking about adding support for this. We're tracking it here: https://github.com/postmanlabs/postman-app-support/issues/1669.

sudheerj commented 7 years ago

POSTMAN will support graphql queries with the header Content-Type:application/graphql.But there is no way to provide dynamic variables just like Graphiql provides. image

SCKelemen commented 7 years ago

What do you mean by 'no way'??

sudheerj commented 7 years ago

I mean there is no query variable section with in POSTMAN just like GraphiQL

narbit commented 5 years ago

Late to the party, but until we have native support for GraphQL in Postman, dynamic query variables can be passed inline. Using the example from the original post:

{ "query": "{ GetAccounts(filter: { region: \"APAC\" } ) { account_name } }" }

This works well for mutations as well.