Skip to content

Commit

Permalink
fix: DateTime is not autogenerated in .tailcallrc.graphql (#2992)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddOnTop authored Oct 11, 2024
1 parent a46a773 commit 79f89e9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 48 deletions.
62 changes: 34 additions & 28 deletions generated/.tailcallrc.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,9 @@ directive @upstream(
) on SCHEMA

"""
Field whose value is a sequence of bytes.
"""
scalar Bytes

"""
Field whose value conforms to the standard date format as specified in RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339).
Empty scalar type represents an empty value.
"""
scalar Date
scalar Empty

"""
Field whose value conforms to the standard internet email address format as specified
Expand All @@ -503,50 +498,61 @@ in HTML Spec: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-add
scalar Email

"""
Empty scalar type represents an empty value.
Field whose value conforms to the standard E.164 format as specified in E.164 specification
(https://en.wikipedia.org/wiki/E.164).
"""
scalar Empty
scalar PhoneNumber

"""
Field whose value is a 128-bit signed integer.
Field whose value conforms to the standard date format as specified in RFC 3339 (https://datatracker.ietf.org/doc/html/rfc3339).
"""
scalar Int128
scalar Date

"""
Field whose value is a 16-bit signed integer.
Field whose value conforms to the standard datetime format as specified in RFC 3339
(https://datatracker.ietf.org/doc/html/rfc3339").
"""
scalar Int16
scalar DateTime

"""
Field whose value is a 32-bit signed integer.
Field whose value conforms to the standard URL format as specified in RFC 3986 (https://datatracker.ietf.org/doc/html/rfc3986).
"""
scalar Int32
scalar Url

"""
Field whose value is a 64-bit signed integer.
Field whose value conforms to the standard JSON format as specified in RFC 8259 (https://datatracker.ietf.org/doc/html/rfc8259).
"""
scalar Int64
scalar JSON

"""
Field whose value is an 8-bit signed integer.
"""
scalar Int8

"""
Field whose value conforms to the standard JSON format as specified in RFC 8259 (https://datatracker.ietf.org/doc/html/rfc8259).
Field whose value is a 16-bit signed integer.
"""
scalar JSON
scalar Int16

"""
Field whose value conforms to the standard E.164 format as specified in E.164 specification
(https://en.wikipedia.org/wiki/E.164).
Field whose value is a 32-bit signed integer.
"""
scalar PhoneNumber
scalar Int32

"""
Field whose value is a 128-bit unsigned integer.
Field whose value is a 64-bit signed integer.
"""
scalar UInt128
scalar Int64

"""
Field whose value is a 128-bit signed integer.
"""
scalar Int128

"""
Field whose value is an 8-bit unsigned integer.
"""
scalar UInt8

"""
Field whose value is a 16-bit unsigned integer.
Expand All @@ -564,14 +570,14 @@ Field whose value is a 64-bit unsigned integer.
scalar UInt64

"""
Field whose value is an 8-bit unsigned integer.
Field whose value is a 128-bit unsigned integer.
"""
scalar UInt8
scalar UInt128

"""
Field whose value conforms to the standard URL format as specified in RFC 3986 (https://datatracker.ietf.org/doc/html/rfc3986).
Field whose value is a sequence of bytes.
"""
scalar Url
scalar Bytes

"""
Provides the ability to refer to a field defined in the root Query or Mutation.
Expand Down
29 changes: 9 additions & 20 deletions src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use derive_setters::Setters;
use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use strum::IntoEnumIterator;
use tailcall_typedefs_common::directive_definition::DirectiveDefinition;
use tailcall_typedefs_common::input_definition::InputDefinition;
use tailcall_typedefs_common::ServiceDocumentBuilder;
Expand Down Expand Up @@ -595,7 +596,7 @@ impl Config {
let generated_types = &mut generated_types;

let builder = ServiceDocumentBuilder::new();
builder
let mut builder = builder
.add_directive(AddField::directive_definition(generated_types))
.add_directive(Alias::directive_definition(generated_types))
.add_directive(Cache::directive_definition(generated_types))
Expand All @@ -619,25 +620,13 @@ impl Config {
.add_input(JS::input_definition())
.add_input(Modify::input_definition())
.add_input(Cache::input_definition())
.add_input(Telemetry::input_definition())
.add_scalar(Scalar::Bytes.scalar_definition())
.add_scalar(Scalar::Date.scalar_definition())
.add_scalar(Scalar::Email.scalar_definition())
.add_scalar(Scalar::Empty.scalar_definition())
.add_scalar(Scalar::Int128.scalar_definition())
.add_scalar(Scalar::Int16.scalar_definition())
.add_scalar(Scalar::Int32.scalar_definition())
.add_scalar(Scalar::Int64.scalar_definition())
.add_scalar(Scalar::Int8.scalar_definition())
.add_scalar(Scalar::JSON.scalar_definition())
.add_scalar(Scalar::PhoneNumber.scalar_definition())
.add_scalar(Scalar::UInt128.scalar_definition())
.add_scalar(Scalar::UInt16.scalar_definition())
.add_scalar(Scalar::UInt32.scalar_definition())
.add_scalar(Scalar::UInt64.scalar_definition())
.add_scalar(Scalar::UInt8.scalar_definition())
.add_scalar(Scalar::Url.scalar_definition())
.build()
.add_input(Telemetry::input_definition());

for scalar in Scalar::iter() {
builder = builder.add_scalar(scalar.scalar_definition());
}

builder.build()
}
}

Expand Down

1 comment on commit 79f89e9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 7.27ms 3.22ms 43.92ms 73.25%
Req/Sec 3.50k 423.98 4.59k 94.83%

418214 requests in 30.02s, 786.30MB read

Requests/sec: 13930.77

Transfer/sec: 26.19MB

Please sign in to comment.