+6
-3
src/swell/executor.gleam
+6
-3
src/swell/executor.gleam
···
155
let root_type = schema.query_type(graphql_schema)
156
// Apply variable defaults
157
let merged_vars = apply_variable_defaults(variables, ctx.variables, ctx)
158
-
let ctx_with_defaults = schema.Context(ctx.data, ctx.arguments, merged_vars)
159
execute_selection_set(
160
selection_set,
161
root_type,
···
185
case schema.get_mutation_type(graphql_schema) {
186
option.Some(mutation_type) -> {
187
// Apply variable defaults
188
-
let merged_vars = apply_variable_defaults(variables, ctx.variables, ctx)
189
let ctx_with_defaults =
190
schema.Context(ctx.data, ctx.arguments, merged_vars)
191
execute_selection_set(
···
220
case schema.get_subscription_type(graphql_schema) {
221
option.Some(subscription_type) -> {
222
// Apply variable defaults
223
-
let merged_vars = apply_variable_defaults(variables, ctx.variables, ctx)
224
let ctx_with_defaults =
225
schema.Context(ctx.data, ctx.arguments, merged_vars)
226
execute_selection_set(
···
155
let root_type = schema.query_type(graphql_schema)
156
// Apply variable defaults
157
let merged_vars = apply_variable_defaults(variables, ctx.variables, ctx)
158
+
let ctx_with_defaults =
159
+
schema.Context(ctx.data, ctx.arguments, merged_vars)
160
execute_selection_set(
161
selection_set,
162
root_type,
···
186
case schema.get_mutation_type(graphql_schema) {
187
option.Some(mutation_type) -> {
188
// Apply variable defaults
189
+
let merged_vars =
190
+
apply_variable_defaults(variables, ctx.variables, ctx)
191
let ctx_with_defaults =
192
schema.Context(ctx.data, ctx.arguments, merged_vars)
193
execute_selection_set(
···
222
case schema.get_subscription_type(graphql_schema) {
223
option.Some(subscription_type) -> {
224
// Apply variable defaults
225
+
let merged_vars =
226
+
apply_variable_defaults(variables, ctx.variables, ctx)
227
let ctx_with_defaults =
228
schema.Context(ctx.data, ctx.arguments, merged_vars)
229
execute_selection_set(
+27
-5
test/parser_test.gleam
+27
-5
test/parser_test.gleam
···
746
parser.Document([
747
parser.NamedQuery(
748
name: "Test",
749
-
variables: [parser.Variable("count", "Int", option.Some(parser.IntValue("20")))],
750
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
751
),
752
]) -> True
···
766
parser.Document([
767
parser.NamedQuery(
768
name: "Test",
769
-
variables: [parser.Variable("name", "String", option.Some(parser.StringValue("Alice")))],
770
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
771
),
772
]) -> True
···
785
parser.Document([
786
parser.NamedQuery(
787
name: "Test",
788
-
variables: [parser.Variable("active", "Boolean", option.Some(parser.BooleanValue(True)))],
789
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
790
),
791
]) -> True
···
804
parser.Document([
805
parser.NamedQuery(
806
name: "Test",
807
-
variables: [parser.Variable("filter", "String", option.Some(parser.NullValue))],
808
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
809
),
810
]) -> True
···
823
parser.Document([
824
parser.NamedQuery(
825
name: "Test",
826
-
variables: [parser.Variable("sort", "SortOrder", option.Some(parser.EnumValue("DESC")))],
827
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
828
),
829
]) -> True
···
746
parser.Document([
747
parser.NamedQuery(
748
name: "Test",
749
+
variables: [
750
+
parser.Variable("count", "Int", option.Some(parser.IntValue("20"))),
751
+
],
752
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
753
),
754
]) -> True
···
768
parser.Document([
769
parser.NamedQuery(
770
name: "Test",
771
+
variables: [
772
+
parser.Variable(
773
+
"name",
774
+
"String",
775
+
option.Some(parser.StringValue("Alice")),
776
+
),
777
+
],
778
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
779
),
780
]) -> True
···
793
parser.Document([
794
parser.NamedQuery(
795
name: "Test",
796
+
variables: [
797
+
parser.Variable(
798
+
"active",
799
+
"Boolean",
800
+
option.Some(parser.BooleanValue(True)),
801
+
),
802
+
],
803
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
804
),
805
]) -> True
···
818
parser.Document([
819
parser.NamedQuery(
820
name: "Test",
821
+
variables: [
822
+
parser.Variable("filter", "String", option.Some(parser.NullValue)),
823
+
],
824
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
825
),
826
]) -> True
···
839
parser.Document([
840
parser.NamedQuery(
841
name: "Test",
842
+
variables: [
843
+
parser.Variable(
844
+
"sort",
845
+
"SortOrder",
846
+
option.Some(parser.EnumValue("DESC")),
847
+
),
848
+
],
849
selections: parser.SelectionSet([parser.Field("users", None, [], [])]),
850
),
851
]) -> True