Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

study graphql #126

Open
41 tasks
nongrata081 opened this issue Aug 5, 2019 · 16 comments
Open
41 tasks

study graphql #126

nongrata081 opened this issue Aug 5, 2019 · 16 comments

Comments

@nongrata081
Copy link
Owner

nongrata081 commented Aug 5, 2019

Youtube talks

Takeouts:

  1. Was developed @facebook in order to make mobile (and web) apps faster
  • by reducing amount of http calls to be made (an average time for a roundtrip to a rest resource was ~12 sec, multiplied by number of nested levels for nested requests), since on mobile phones given the mobile networks making nested http requests could take up to ~60 seconds and more.

Benefits:

  1. Speed
    Get all data client needs with 1 request (same dome with REST with multiple requests only, which means the app is slower & less responsive to the user - since more time of awaiting for data, while multiple http roundtrips are done via rest).
  2. Static types (type system on client)
    (enables static code analysis & type checks in code edit time). While TS doesn't give type safety, as is only applicable to client, not what server sends.
  3. Clean syntax
    Much cleaner & intuitively understandable syntax compared to other query languages (e.g. SQL). With gql you specify query which is a data tree you want to get, and get json object in response. Compare a complex SQL query to a complex GQL query.
  4. Flexibility
    with which data you get (every field is a function, which can have arguments)
    composition of types with ... notation
  5. Freedom
    aliases - you can specify an alias under which you will get fields, which might be specified as functions with arguments
  6. Agility With GQL models are being stored on the client, what drops the need for syncing the local and remote state (data on the client & on the server). Previously models were stored on the server, and client had to fetch them first. Then, after changing the data anyhow, client had to update server with the new changed data.
  7. Auto-documented code (documentation generated from type system).
  8. Code generation (generate model objects from types)
  9. IDE integration (syntax highlighting, context-sensitive type-aheads, validation)

GraphQL concepts

36 Concepts Every GraphQL Developer Should Know

Specs

Server

Client

Best Practices

@nongrata081
Copy link
Owner Author

study apollo pagination

@nongrata081
Copy link
Owner Author

graphql codegen & others

extract items & convert into issues to this repo from

https://habr.com/ru/company/ruvds/blog/456340/

@nongrata081
Copy link
Owner Author

existing graphql apis

https://github.com/APIs-guru/graphql-apis

@nongrata081
Copy link
Owner Author

add graphql related schematics

https://apis.guru/

@nongrata081
Copy link
Owner Author

add schematics for graphql stuff

https://nordicapis.com/10-awesome-tools-and-extensions-for-graphql-apis/

@nongrata081
Copy link
Owner Author

study & consider cf workers + gql on the edge

https://github.com/alber70g/cloudflare-graphql-ts
https://workers.cloudflare.com/
https://cloudflareworkers.com/#12a9195720fe4ed660949efdbd9c0219:https://tutorial.cloudflareworkers.com

  1. less waterfall queries from the frontend. This is especially useful for mobile devices or emerging markets where internet connections aren’t as good as in the west
  2. with this approach, anyone can make a /graphql endpoint for a third-party api without exposing api-keys to the frontend (which would be the case when you implement graphqljs=schema+resolvers in the client)
  3. since GraphQL works with POST method, you cannot cache this with a regular CDN. With CF workers you can create a cache based on this

@nongrata081 nongrata081 changed the title study graphql concepts study graphql Aug 5, 2019
@nongrata081
Copy link
Owner Author

@nongrata081
Copy link
Owner Author

  • Awesome Angular GraphQL - a curated collection of resources, clients and tools that make working with GraphQL and Angular awesome.

@nongrata081
Copy link
Owner Author

@nongrata081
Copy link
Owner Author

@nongrata081
Copy link
Owner Author

nongrata081 commented Aug 6, 2019

@nongrata081
Copy link
Owner Author

nongrata081 commented Aug 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant