Better experience for GraphQL requests
bayne opened this issue · comments
Brian Payne commented
Attempting to create requests for a GraphQL server leads to some nasty syntax:
#9 (comment)
Current plan for a response body generator:
POST {{base_url}}/graphql
< {%
var query = '{\
leftComparison: hero(episode: EMPIRE) {\
...comparisonFields\
}\
rightComparison: hero(episode: JEDI) {\
...comparisonFields\
}\
}\
fragment comparisonFields on Character {\
name\
appearsIn\
friends {\
name\
}\
}';
return {
"query": query
};
%}
> {% console.log(response); %}
Note the symmetry of the syntax:
< {% ... %}
for a request body generator> {% ... %}
for a response handler (existing)