跳到主要内容

GraphQL

# 获取 Schema
npm install -g graphqurl
gq https://my-graphql-engine.com/v1/graphql --introspect > schema.graphql
gq https://my-graphql-engine.com/v1/graphql -H 'X-Hasura-Admin-Secret: adminsecretkey' --introspect > schema.graphql
gq https://my-graphql-engine.com/v1/graphql --introspect --format json > schema.json

# https://github.com/apollographql/apollo-tooling
# schema.json
npm install -g apollo
apollo schema:download --endpoint https://my-graphql-engine.com/v1/graphql
apollo schema:download --endpoint https://my-graphql-engine.com/v1/graphql --header 'X-Hasura-Admin-Secret: adminsecretkey'

Apollo

FAQ

N + 1

DateTime

vs REST

TBD

http://graphql.org/code/

https://github.com/skevy/graphiql-app Light, Electron-based Wrapper around GraphiQL

https://github.com/apollographql/apollo-server

https://github.com/graphcool/graphql-playground GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)

docker run -p 5000:5000 postgraphql/postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA

https://github.com/chentsulin/awesome-graphql Awesome list of GraphQL & Relay

https://www.graphql.com/ http://graphql.org/learn/best-practices/ GraphQL Best Practices

https://www.apollographql.com/ Apollo provides a universal GraphQL API on top of your existing services, so you can build new application features fast without waiting on backend changes.

https://github.com/facebook/dataloader DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.

https://blog.datank.ai/graphql-grpc-part-1-54d92a109619 GraphQL & gRPC

relay

global id