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

Working with graphql scalars #362

Draft
wants to merge 54 commits into
base: develop
Choose a base branch
from

Conversation

ayush2390
Copy link
Contributor

This blog will help the readers to get a deep understanding of GraphQL Scalars, covering its importance in API development and data manipulation. Readers will learn about the implementation of both default and custom Scalar types, along with best practices for efficient schema design and data handling. Upcoming future trends and advancements in Scalar technology, empowering readers to leverage these insights for optimized GraphQL development.

@amitksingh1490 amitksingh1490 marked this pull request as draft July 25, 2024 07:55
@Frenzyritz13
Copy link
Contributor

Hey @ayush2390 I really like the exhaustive approach to the topic. I would like you to make a few changes to the outline before you start writing on this.

  1. If you want to cover all of the points you have mentioned in enough detail, I would recommend splitting it into parts.
  2. While covering different topics, instead of just listing the topic and putting the info, I would recommend creating a problem-solution approach. You want to make the user interested in the "why" of it along with the "how" of it.
  3. I would recommend using a few analogies and keep calling back to them. It's okay if it the analogy gets a little ridiculous but memorable.
  4. Conclusion is always very important. Make sure you add a Call to Action for the reader. This is up to you. You want to first link your next part and then either ask them to talk about what they learned by going on twitter/discord or any of the other Tailcall channels.

Here is a checklist for you to make a copy and put your article through. https://docs.google.com/document/d/1Bw9iT4ws9q093kCJsnStfpByJljn-wRPNtc575s3_R8/edit?usp=sharing
There are also guidelines on how to split the information into parts. Just as an example, considering the topics listed in your overview, here is how I would split it.

Part 1: Working with GraphQL Scalars Part 1

Introduction

A. Introduction to GraphQL Scalars

B. Understanding GraphQL Scalar types

  • Characteristics of Scalars

C. Scalars as fundamental data types

  • Difference from non-scalar types

Evolution of GraphQL Scalars

A. History of GraphQL Types

B. Adoption from traditional types to GraphQL Scalars

C. Impact of Scalars on Modern API Development

Significance of GraphQL Scalars

A. Importance of Scalars in GraphQL

  • Shaping GraphQL APIs with Scalars

B. Role in data representation

C. Data Manipulation Using Scalars

(Example - Examples of Scalar-enabled Data Manipulation)

Defining Scalar in Schema

A. Role of Scalars in Schema Definition

B. Representation of Scalar in SDL (Schema Definition Language)

  • Incorporating Scalar in Schema

  • C. Integrating Scalar types in GraphQL Types

  • Specifying scalar Types for Fields

Conclusion

Part 2: Working with GraphQL Scalars Part 2

  • Introduction

Implementing Scalars in Queries and Mutations

A. Retrieving Data Using Scalar Types

  • Step-by-Step Guide to Data Retrieval

    (Example - Querying Data with Scalars)

    (Diagram - Flowchart of Data Retrieval Process)

B. Using Scalars in Mutation Operations

  • Utilizing Scalars in Mutations

    (Diagram - Illustrating the use of scalar types in mutations)

C. Multiple Mutation Operations using Scalar

Types of Scalars

A. Overview of Scalar types in GraphQL

B. HaHandling Basic Data Values

C. Detailed Examination of Scalar types

  • Default Types

  • Custom Types

  • Mixed Scalar Types

  • Streamline Data Handling in GraphQL APIs

Default Scalar types

A. Default Scalar Types in GraphQL

  • String, Int, Float, Boolean, ID

B. Data representation Using Default Types

(Examples - TEffective Data Representation with Default Scalars)

Conclusion

Part 3: Working with GraphQL Scalars Part 3

  • Introduction

Custom Scalar types

A. Overview of Custom Scalar Types

B. Importance of Custom Scalar Types

C. Defining and Implementing Custom Types

  • Custom Scalars provided by Tailcall

Default VS Custom Scalar types

A. Comparison between Default vs Custom Types

  • Data Representation
  • Flexibility
  • Performance
  • Complexity

GraphQL Scalar Resolver Functions

A. Role of Resolvers in GraphQL

B. Anatomy of a Scalar Resolver Function

  • Serialization

  • Parsing

  • Validation

C. Linking Scalars with Resolver Functions

Integrating with Apollo Client

A. Introduction to Apollo Client

B. Using GraphQL Scalars in Apollo Client

  • Setting up Apollo client

C. Mutating Scalars with Apollo Client

Tools and Libraries for GraphQL Scalar

A. Popular libraries for GraphQL scalar (graph-scalar, graphql-java, graphql-upload)

B. GraphQL code Generator Tools

C. GraphQL Codegen Server Preset

Benefits of using Scalar Types

A. Efficient Data Transfer

B. Data Validation and Type Safety

C. API Contracts

D. Compatibility and Interoperability

Best Practices for Scalars

A. Custom scalars for specialised data types

B. Versioning and Compatibility

C. Handling errors

D. Using Default Scalars

Validation and Error Handling

A. Validation in GraphQL Scalars

B. Techniques to Validating Scalar Inputs

C. Custom Error Messages

Future of GraphQL Scalars

A. Potential Improvements and Extensions

B. Future Trends in Custom Scalar types

Conclusion

A. Recap of Key Features and Benefits of GraphQL Scalars

B. Summary of Using Scalars and Resolver Functions with Apollo Client in Projects

@ayush2390
Copy link
Contributor Author

@Frenzyritz13 I have addressed your points and updated the blog outline.

When I'll start writing this blog, I'll follow the analogy point and problem-solution approach you have mentioned above

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

Successfully merging this pull request may close these issues.

2 participants