【发布时间】:2018-11-01 07:55:09
【问题描述】:
Angular5 中使用 Apollo GraphQL 发送 GET 请求的查询格式是什么?
我用过
this.querySubscription = this.apollo.watchQuery<any>({
query: gql`
query listSchemaAttributes($schemaDomain: String!) {
query listSchemaAttributes(schemaDomain: $schemaDomain) {
type
uniqueName
isList
}
}
`,
variables: {
schemaDomain: "abc",
},
})
.valueChanges
.subscribe(({data}) => {
this.currentUser = data.currentUser;
});
当我签入网络选项卡时,此请求以 POST 方法发送,但我需要以 GET 方法发送。请帮我解决这个问题。谢谢
【问题讨论】:
标签: angular get graphql apollo-client