bluejay 0.1.0.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Cargo.lock +423 -0
- data/Cargo.toml +2 -0
- data/LICENSE +21 -0
- data/README.md +33 -0
- data/ext/Cargo.toml +17 -0
- data/ext/extconf.rb +6 -0
- data/ext/src/execution/coerce_result.rs +54 -0
- data/ext/src/execution/engine.rs +466 -0
- data/ext/src/execution/execution_error.rs +28 -0
- data/ext/src/execution/field_error.rs +8 -0
- data/ext/src/execution/key_store.rs +23 -0
- data/ext/src/execution.rs +10 -0
- data/ext/src/helpers/public_name.rs +21 -0
- data/ext/src/helpers/typed_frozen_r_array.rs +56 -0
- data/ext/src/helpers/wrapped_definition.rs +79 -0
- data/ext/src/helpers/wrapped_struct.rs +97 -0
- data/ext/src/helpers.rs +8 -0
- data/ext/src/lib.rs +10 -0
- data/ext/src/ruby_api/arguments_definition.rs +8 -0
- data/ext/src/ruby_api/coerce_input.rs +6 -0
- data/ext/src/ruby_api/coercion_error.rs +61 -0
- data/ext/src/ruby_api/custom_scalar_type_definition.rs +62 -0
- data/ext/src/ruby_api/enum_type_definition.rs +107 -0
- data/ext/src/ruby_api/enum_value_definition.rs +58 -0
- data/ext/src/ruby_api/enum_value_definitions.rs +8 -0
- data/ext/src/ruby_api/execution_error.rs +48 -0
- data/ext/src/ruby_api/execution_result.rs +40 -0
- data/ext/src/ruby_api/field_definition.rs +112 -0
- data/ext/src/ruby_api/fields_definition.rs +8 -0
- data/ext/src/ruby_api/input_fields_definition.rs +8 -0
- data/ext/src/ruby_api/input_object_type_definition.rs +138 -0
- data/ext/src/ruby_api/input_type_reference.rs +358 -0
- data/ext/src/ruby_api/input_value_definition.rs +98 -0
- data/ext/src/ruby_api/interface_implementation.rs +42 -0
- data/ext/src/ruby_api/interface_implementations.rs +8 -0
- data/ext/src/ruby_api/interface_type_definition.rs +82 -0
- data/ext/src/ruby_api/json_value.rs +111 -0
- data/ext/src/ruby_api/object_type_definition.rs +100 -0
- data/ext/src/ruby_api/output_type_reference.rs +238 -0
- data/ext/src/ruby_api/r_result.rs +84 -0
- data/ext/src/ruby_api/scalar.rs +45 -0
- data/ext/src/ruby_api/schema_definition.rs +270 -0
- data/ext/src/ruby_api/union_member_type.rs +41 -0
- data/ext/src/ruby_api/union_member_types.rs +8 -0
- data/ext/src/ruby_api/union_type_definition.rs +89 -0
- data/ext/src/ruby_api/validation_error.rs +63 -0
- data/ext/src/ruby_api.rs +75 -0
- data/lib/bluejay/base_input_type_reference.rb +13 -0
- data/lib/bluejay/base_output_type_reference.rb +15 -0
- data/lib/bluejay/custom_scalar_type.rb +40 -0
- data/lib/bluejay/enum_type.rb +44 -0
- data/lib/bluejay/ext.bundle +0 -0
- data/lib/bluejay/finalize.rb +27 -0
- data/lib/bluejay/input_type.rb +64 -0
- data/lib/bluejay/input_type_reference_shorthands.rb +28 -0
- data/lib/bluejay/interface_type.rb +60 -0
- data/lib/bluejay/json_value.rb +16 -0
- data/lib/bluejay/name_from_class.rb +18 -0
- data/lib/bluejay/object_type.rb +68 -0
- data/lib/bluejay/output_type_reference_shorthands.rb +28 -0
- data/lib/bluejay/schema.rb +63 -0
- data/lib/bluejay/union_type.rb +43 -0
- data/lib/bluejay/version.rb +5 -0
- data/lib/bluejay.rb +28 -0
- data/lib/rbi_ext/model.rb +64 -0
- data/lib/tapioca/dsl/compilers/input_type.rb +34 -0
- data/lib/tapioca/dsl/compilers/interface_type.rb +29 -0
- data/lib/tapioca/dsl/compilers/object_type.rb +43 -0
- data/lib/tapioca/dsl/compilers/schema.rb +42 -0
- metadata +131 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require_relative "../../../rbi_ext/model"
|
5
|
+
|
6
|
+
module Tapioca
|
7
|
+
module Compilers
|
8
|
+
class ObjectType < Tapioca::Dsl::Compiler
|
9
|
+
extend T::Sig
|
10
|
+
|
11
|
+
ConstantType = type_member { { fixed: T.class_of(Bluejay::ObjectType) } }
|
12
|
+
|
13
|
+
sig { override.returns(T::Enumerable[Module]) }
|
14
|
+
def self.gather_constants
|
15
|
+
all_classes.select { |c| c < Bluejay::ObjectType }
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { override.void }
|
19
|
+
def decorate
|
20
|
+
root.create_path(constant.const_get(:Interface)) do |klass|
|
21
|
+
klass.custom_create_method("resolve_typename", return_type: "String", is_final: true)
|
22
|
+
|
23
|
+
klass.mark_abstract
|
24
|
+
|
25
|
+
constant.interface_implementations.each do |interface_implementation|
|
26
|
+
interface = interface_implementation.interface.const_get(:Interface)
|
27
|
+
klass.create_include(interface.name)
|
28
|
+
end
|
29
|
+
|
30
|
+
constant.field_definitions.each do |field_definition|
|
31
|
+
parameters = field_definition.argument_definitions.map do |argument_definition|
|
32
|
+
create_param(argument_definition.name, type: argument_definition.type.sorbet_type)
|
33
|
+
end
|
34
|
+
|
35
|
+
return_type = field_definition.type.sorbet_type
|
36
|
+
|
37
|
+
klass.custom_create_method(field_definition.resolver_method_name, parameters:, return_type:, is_abstract: true)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require_relative "../../../rbi_ext/model"
|
5
|
+
|
6
|
+
module Tapioca
|
7
|
+
module Compilers
|
8
|
+
class Schema < Tapioca::Dsl::Compiler
|
9
|
+
extend T::Sig
|
10
|
+
|
11
|
+
ConstantType = type_member { { fixed: T.class_of(Bluejay::Schema) } }
|
12
|
+
|
13
|
+
sig { override.returns(T::Enumerable[Module]) }
|
14
|
+
def self.gather_constants
|
15
|
+
all_classes.select { |c| c < Bluejay::Schema }
|
16
|
+
end
|
17
|
+
|
18
|
+
sig { override.void }
|
19
|
+
def decorate
|
20
|
+
root.create_path(constant) do |klass|
|
21
|
+
parameters = [
|
22
|
+
create_kw_param("query", type: "String"),
|
23
|
+
create_kw_param("operation_name", type: "T.nilable(String)"),
|
24
|
+
create_kw_param("initial_value", type: "#{constant.name}::Root"),
|
25
|
+
create_kw_opt_param("variables", type: "T::Hash[String, T.untyped]", default: "{}"),
|
26
|
+
]
|
27
|
+
klass.custom_create_method("execute", return_type: "Bluejay::ExecutionResult", parameters:, class_method: true)
|
28
|
+
end
|
29
|
+
|
30
|
+
root.create_path(constant.const_get(:Root)) do |klass|
|
31
|
+
klass.mark_interface
|
32
|
+
|
33
|
+
klass.custom_create_method("query", return_type: constant.query.const_get(:Interface).name, is_abstract: true)
|
34
|
+
|
35
|
+
if (mutation = constant.mutation)
|
36
|
+
klass.custom_create_method("mutation", return_type: mutation.const_get(:Interface).name, is_abstract: true)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bluejay
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.alpha.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Petro
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-01-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sorbet-runtime
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: A fast GraphQL engine.
|
28
|
+
email:
|
29
|
+
- adamapetro@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions:
|
32
|
+
- ext/extconf.rb
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- Cargo.lock
|
36
|
+
- Cargo.toml
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
|
+
- ext/Cargo.toml
|
40
|
+
- ext/extconf.rb
|
41
|
+
- ext/src/execution.rs
|
42
|
+
- ext/src/execution/coerce_result.rs
|
43
|
+
- ext/src/execution/engine.rs
|
44
|
+
- ext/src/execution/execution_error.rs
|
45
|
+
- ext/src/execution/field_error.rs
|
46
|
+
- ext/src/execution/key_store.rs
|
47
|
+
- ext/src/helpers.rs
|
48
|
+
- ext/src/helpers/public_name.rs
|
49
|
+
- ext/src/helpers/typed_frozen_r_array.rs
|
50
|
+
- ext/src/helpers/wrapped_definition.rs
|
51
|
+
- ext/src/helpers/wrapped_struct.rs
|
52
|
+
- ext/src/lib.rs
|
53
|
+
- ext/src/ruby_api.rs
|
54
|
+
- ext/src/ruby_api/arguments_definition.rs
|
55
|
+
- ext/src/ruby_api/coerce_input.rs
|
56
|
+
- ext/src/ruby_api/coercion_error.rs
|
57
|
+
- ext/src/ruby_api/custom_scalar_type_definition.rs
|
58
|
+
- ext/src/ruby_api/enum_type_definition.rs
|
59
|
+
- ext/src/ruby_api/enum_value_definition.rs
|
60
|
+
- ext/src/ruby_api/enum_value_definitions.rs
|
61
|
+
- ext/src/ruby_api/execution_error.rs
|
62
|
+
- ext/src/ruby_api/execution_result.rs
|
63
|
+
- ext/src/ruby_api/field_definition.rs
|
64
|
+
- ext/src/ruby_api/fields_definition.rs
|
65
|
+
- ext/src/ruby_api/input_fields_definition.rs
|
66
|
+
- ext/src/ruby_api/input_object_type_definition.rs
|
67
|
+
- ext/src/ruby_api/input_type_reference.rs
|
68
|
+
- ext/src/ruby_api/input_value_definition.rs
|
69
|
+
- ext/src/ruby_api/interface_implementation.rs
|
70
|
+
- ext/src/ruby_api/interface_implementations.rs
|
71
|
+
- ext/src/ruby_api/interface_type_definition.rs
|
72
|
+
- ext/src/ruby_api/json_value.rs
|
73
|
+
- ext/src/ruby_api/object_type_definition.rs
|
74
|
+
- ext/src/ruby_api/output_type_reference.rs
|
75
|
+
- ext/src/ruby_api/r_result.rs
|
76
|
+
- ext/src/ruby_api/scalar.rs
|
77
|
+
- ext/src/ruby_api/schema_definition.rs
|
78
|
+
- ext/src/ruby_api/union_member_type.rs
|
79
|
+
- ext/src/ruby_api/union_member_types.rs
|
80
|
+
- ext/src/ruby_api/union_type_definition.rs
|
81
|
+
- ext/src/ruby_api/validation_error.rs
|
82
|
+
- lib/bluejay.rb
|
83
|
+
- lib/bluejay/base_input_type_reference.rb
|
84
|
+
- lib/bluejay/base_output_type_reference.rb
|
85
|
+
- lib/bluejay/custom_scalar_type.rb
|
86
|
+
- lib/bluejay/enum_type.rb
|
87
|
+
- lib/bluejay/ext.bundle
|
88
|
+
- lib/bluejay/finalize.rb
|
89
|
+
- lib/bluejay/input_type.rb
|
90
|
+
- lib/bluejay/input_type_reference_shorthands.rb
|
91
|
+
- lib/bluejay/interface_type.rb
|
92
|
+
- lib/bluejay/json_value.rb
|
93
|
+
- lib/bluejay/name_from_class.rb
|
94
|
+
- lib/bluejay/object_type.rb
|
95
|
+
- lib/bluejay/output_type_reference_shorthands.rb
|
96
|
+
- lib/bluejay/schema.rb
|
97
|
+
- lib/bluejay/union_type.rb
|
98
|
+
- lib/bluejay/version.rb
|
99
|
+
- lib/rbi_ext/model.rb
|
100
|
+
- lib/tapioca/dsl/compilers/input_type.rb
|
101
|
+
- lib/tapioca/dsl/compilers/interface_type.rb
|
102
|
+
- lib/tapioca/dsl/compilers/object_type.rb
|
103
|
+
- lib/tapioca/dsl/compilers/schema.rb
|
104
|
+
homepage: https://github.com/adampetro/bluejay-rb
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata:
|
108
|
+
homepage_uri: https://github.com/adampetro/bluejay-rb
|
109
|
+
source_code_uri: https://github.com/adampetro/bluejay-rb
|
110
|
+
changelog_uri: https://github.com/adampetro/bluejay-rb/blob/main/CHANGELOG
|
111
|
+
cargo_crate_name: ext
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options: []
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 3.1.0
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.3.1
|
126
|
+
requirements: []
|
127
|
+
rubygems_version: 3.4.1
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: A fast GraphQL engine.
|
131
|
+
test_files: []
|