What are scalar types in graphql?

Member

by gilbert , in category: Javascript , 6 months ago

What are scalar types in graphql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by adan , 6 months ago

@gilbert 

In GraphQL, scalar types are the most basic data types that can be used to define the shape of data in a GraphQL schema. Scalar types represent a single atomic value, such as a string, number, boolean, or custom scalar type. These scalar types are used to define the types of fields in a GraphQL schema and can be used as arguments or return types for field resolvers. Scalars are immutable and have no subfields. Some popular built-in scalar types in GraphQL include String, Int, Float, Boolean, and ID. Additionally, GraphQL allows developers to define custom scalar types for more complex data structures.