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

feat(config): redefine type layout #1856

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/jsonplaceholder.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "./.tailcallrc.schema.json",
"$schema": "../generated/.tailcallrc.schema.json",
"server": {
"hostname": "0.0.0.0",
"port": 8000
Expand Down
1 change: 1 addition & 0 deletions examples/jsonplaceholder.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../generated/.tailcallrc.schema.json
server:
hostname: 0.0.0.0
port: 8000
Expand Down
160 changes: 83 additions & 77 deletions generated/.tailcallrc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@
"$ref": "#/definitions/Type"
}
},
"unions": {
"description": "A map of all the union types in the schema.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Union"
}
},
"upstream": {
"description": "Dictates how tailcall should handle upstream requests/responses. Tuning upstream can improve performance and reliability for connections.",
"default": {},
Expand Down Expand Up @@ -333,6 +326,22 @@
"ApplicationXWwwFormUrlencoded"
]
},
"EnumType": {
"type": "object",
"required": [
"variants"
],
"properties": {
"variants": {
"description": "Variants for the type if it's an enum",
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
}
}
},
"Expr": {
"description": "The `@expr` operators allows you to specify an expression that can evaluate to a value. The expression can be a static value or built form a Mustache template. schema.",
"type": "object",
Expand Down Expand Up @@ -828,6 +837,58 @@
},
"additionalProperties": false
},
"ObjectType": {
"type": "object",
"required": [
"fields"
],
"properties": {
"added_fields": {
"description": "Additional fields to be added to the type",
"type": "array",
"items": {
"$ref": "#/definitions/AddField"
}
},
"cache": {
"description": "Setting to indicate if the type can be cached.",
"anyOf": [
{
"$ref": "#/definitions/Cache"
},
{
"type": "null"
}
]
},
"fields": {
"description": "A map of field name and its definition.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Field"
}
},
"implements": {
"description": "Interfaces that the type implements.",
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"protected": {
"description": "Marks field as protected by auth providers",
"anyOf": [
{
"$ref": "#/definitions/Protected"
},
{
"type": "null"
}
]
}
}
},
"Omit": {
"description": "Used to omit a field from public consumption.",
"type": "object",
Expand Down Expand Up @@ -1190,79 +1251,30 @@
]
},
"Type": {
"description": "Represents a GraphQL type. A type can be an object, interface, enum or scalar.",
"description": "Represents a GraphQL type.",
"type": "object",
"required": [
"fields"
],
"properties": {
"added_fields": {
"description": "Additional fields to be added to the type",
"type": "array",
"items": {
"$ref": "#/definitions/AddField"
}
"anyOf": [
{
"type": "null"
},
"cache": {
"description": "Setting to indicate if the type can be cached.",
"anyOf": [
{
"$ref": "#/definitions/Cache"
},
{
"type": "null"
}
]
{
"$ref": "#/definitions/EnumType"
},
{
"$ref": "#/definitions/ObjectType"
},
{
"$ref": "#/definitions/UnionType"
}
],
"properties": {
"doc": {
"description": "Documentation for the type that is publicly visible.",
"type": [
"string",
"null"
]
},
"enum": {
"description": "Variants for the type if it's an enum",
"type": [
"array",
"null"
],
"items": {
"type": "string"
},
"uniqueItems": true
},
"fields": {
"description": "A map of field name and its definition.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Field"
}
},
"implements": {
"description": "Interfaces that the type implements.",
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"interface": {
"description": "Flag to indicate if the type is an interface.",
"type": "boolean"
},
"protected": {
"description": "Marks field as protected by auth providers",
"default": null,
"anyOf": [
{
"$ref": "#/definitions/Protected"
},
{
"type": "null"
}
]
},
"tag": {
"description": "Contains source information for the type.",
"anyOf": [
Expand All @@ -1276,18 +1288,12 @@
}
}
},
"Union": {
"UnionType": {
"type": "object",
"required": [
"types"
],
"properties": {
"doc": {
"type": [
"string",
"null"
]
},
"types": {
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.75"
channel = "1.77"
profile = "default"
Loading
Loading