从graphql endpoint获取schema文件
graphql server端有更新,client端需要重新獲取schema文件用于創(chuàng)建新的api request,下面簡要記錄如何從graphql endpoint獲取schema文件
You can simply install the CLI using?npm?or?yarn?by running the following command. This will add the?graphql?(and shorter?gql) binary to your path.
npm install -g graphql-cli
Then, you can type [command] just like bellow to create? a? file named? .graphqlconfig
?You can get schema like this.
?
?Ops! Now specific headers is needed. We open .graphqlconfig file to edit it.
?
?Pay attention to edit this file, since it's very important to the result.
At last,? we? get the? damn schema.json by?graphql get-schema --output="schema.json"
?
?Done.?
Happy Mid-Autumn Festival !
?
轉(zhuǎn)載于:https://www.cnblogs.com/fuyaozhishang/p/11515676.html
總結(jié)
以上是生活随笔為你收集整理的从graphql endpoint获取schema文件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 相逢一笑泯恩仇,桃花依旧笑春风的意思
- 下一篇: 电脑怎么清除dns缓存 路由器如何清理d