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

Higher view of GraphQL #1

Open
reboottime opened this issue Feb 11, 2024 · 2 comments
Open

Higher view of GraphQL #1

reboottime opened this issue Feb 11, 2024 · 2 comments
Labels

Comments

@reboottime
Copy link
Owner

reboottime commented Feb 11, 2024

What is it and When to use it

  • What is GraphQL?: what you defined is what you will get.
    GraphQL offers a solution to the issues of under-fetching and over-fetching data present in traditional RESTful APIs by allowing clients to specify the exact data they need through a declarative language
  • When you may want to use it:
    • data source complexity: apply graphql server as the middleware to glue multiple data source, either during BE refactoring or FE needs to work with multiple data source
    • Project with anticipation of future complexity on data
@reboottime
Copy link
Owner Author

reboottime commented Feb 11, 2024

Major Concepts

  • Grammar: Similar to Typescript, support defining new primitive type or composing new type based on other types.

  • GraphQL Concepts Map

    • Schema
      • Types
        • Objects
        • Scalars
        • Enums
        • Interfaces
    • Query Language
      • Fields
      • Reduce over-fetching
    • Resolvers
      • Fetch data for fields
    • Mutations
      • Modify data on server
    • Subscriptions
      • Real-time communication
    • Introspection
      • Query schema
  • Comparison:

image

@reboottime
Copy link
Owner Author

reboottime commented Feb 11, 2024

Production Ready Solutions

  • TypeGraphQL, server side, write query code using typescript
  • Client Side Interaction: Apollo Client, design logic is similar to react query
    • variables passed in are query keys in react query
    • graphql code similar to services, defined as the api contract on data interaction
    • mutation, query concepts

Unresolved problems

  • integration test?

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

No branches or pull requests

1 participant