graphql pass arg
Posted 学者先要会疑
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了graphql pass arg相关的知识,希望对你有一定的参考价值。
var numSides = 6; var numRolls = 3; var xhr = new XMLHttpRequest(); xhr.responseType = ‘json‘; xhr.open("POST", "http://localhost:4000/graphql"); xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("Accept", "application/json"); xhr.onload = function () { console.log(‘data returned:‘, xhr.response); } var query = `query getDiexx($numSides:Int!,$numRolls:Int!) { getDie(numSides: $numSides) { numSides roll(numRolls: $numRolls) } }`; xhr.send(JSON.stringify({ query: query, variables: {numSides: numSides, numRolls: numRolls}, }));
以上是关于graphql pass arg的主要内容,如果未能解决你的问题,请参考以下文章
[RxJS] Implement RxJS `mergeMap` through inner Observables to Subscribe and Pass Values Through(代码片段
[RxJS] Implement RxJS `switchMap` by Canceling Inner Subscriptions as Values are Passed Through(代码片段