Basic Integration
When you define a schema withschemaWithName()
, it can be used directly in GraphQL resolvers:
- Generate the GraphQL type for
UserSchema
- Validate the resolver’s return value against the schema
- Convert any special types (like dates) to the appropriate GraphQL format
GraphQL Schema Customization
You can customize how a schema appears in GraphQL:Generated GraphQL Types
The following table shows how schema types map to GraphQL types:Schema Type | GraphQL Type | Notes |
---|---|---|
String | String | Plain text |
Number | Float | Default numeric type |
'integer' | Int | Whole numbers |
Boolean | Boolean | True/false values |
Date | Date | Custom scalar type |
Schema | Object Type | Nested object definition |
[Type] | [Type] | List of items |
Enum | Enum | Custom enum type |