From 3024ecb62fed871c403b8b812bcc493d32a079f3 Mon Sep 17 00:00:00 2001 From: Artyom Emelyanenko Date: Mon, 27 Jul 2026 17:38:39 +1000 Subject: [PATCH 1/5] Remove all document variables hint --- .../java/graphql/nadel/NadelExecutionHints.kt | 10 -- .../main/java/graphql/nadel/NextgenEngine.kt | 13 +- .../engine/document/DocumentPredicates.kt | 8 -- .../hydration/NadelHydrationInputBuilder.kt | 11 +- .../batch/NadelBatchHydrationInputBuilder.kt | 5 +- .../nadel/hints/AllDocumentVariablesHint.kt | 13 -- .../graphql/nadel/archunit/NadelPrefixTest.kt | 1 - .../kotlin/graphql/nadel/tests/EngineTests.kt | 21 ++- .../tests/ServiceRequestCanonicalizer.kt | 115 +++++++++++++++++ .../tests/ServiceRequestCanonicalizerTest.kt | 76 +++++++++++ .../`introspection-with-variables-ff-on`.kt | 13 -- ...nt-in-renamed-object-input-in-hydration.kt | 5 - ...in-input-rename-with-argument-transform.kt | 5 - .../hooks/document-variables-handling.kt | 22 +--- .../hooks/transformer-on-hydration-fields.kt | 2 +- ...variables inside input objects snapshot.kt | 10 +- ...ent transform on renamed field snapshot.kt | 10 +- .../ari argument transform snapshot.kt | 10 +- ...de batch hydration null object snapshot.kt | 14 +- ... rename inside batch hydration snapshot.kt | 14 +- .../deep rename inside hydration snapshot.kt | 10 +- .../deep rename inside hydrations snapshot.kt | 30 +++-- ...eep rename with argument works snapshot.kt | 10 +- .../inlined json arguments snapshot.kt | 10 +- .../input object with json field snapshot.kt | 8 +- .../primitive json arguments snapshot.kt | 8 +- ...itive json arguments variables snapshot.kt | 8 +- ...tion handles complex fragments snapshot.kt | 10 +- ...agments from multiple services snapshot.kt | 10 +- ...e resolution multiple services snapshot.kt | 20 ++- ... with one unmapped node lookup snapshot.kt | 10 +- ...resolution simple success case snapshot.kt | 10 +- ...e resolution with no fragments snapshot.kt | 10 +- ...sing dynamic resolved services snapshot.kt | 10 +- ...om another service is possible snapshot.kt | 10 +- ...possible with synthetic fields snapshot.kt | 10 +- ...dration returning a connection snapshot.kt | 23 +++- ...ation with arguments passed on snapshot.kt | 13 +- ...ation with variables arguments snapshot.kt | 13 +- ...ion top level field is removed snapshot.kt | 10 +- ...ion top level field is removed snapshot.kt | 10 +- ...ion top level field is removed snapshot.kt | 10 +- ...moved short circuit hint is on snapshot.kt | 10 +- ...graphqlcontextispresentoninput snapshot.kt | 10 +- ... introspection with variables snapshot.kt} | 4 +- ... on.kt => introspection with variables.kt} | 2 +- .../java ari transform snapshot.kt | 10 +- ...same field as hydration source snapshot.kt | 20 ++- ...t are backed a batch hydration snapshot.kt | 13 +- ... result are backed a hydration snapshot.kt | 20 ++- ...t are backed a batch hydration snapshot.kt | 13 +- ... result are backed a hydration snapshot.kt | 20 ++- ...fields are seen by transformer snapshot.kt | 10 +- ...ion with true equals condition snapshot.kt | 10 +- ...on with true matches condition snapshot.kt | 10 +- ...with true startsWith condition snapshot.kt | 10 +- ...asic hydration directive based snapshot.kt | 10 +- .../new hydration/basic hydration snapshot.kt | 10 +- ...ration with actor field rename snapshot.kt | 10 +- ... default array argument values snapshot.kt | 14 +- ...efault boolean argument values snapshot.kt | 11 +- ...th default int argument values snapshot.kt | 11 +- ...h default null argument values snapshot.kt | 11 +- ...default object argument values snapshot.kt | 13 +- ...default string argument values snapshot.kt | 11 +- ...ydration with static arg array snapshot.kt | 15 ++- ...ration with static arg boolean snapshot.kt | 10 +- ...ydration with static arg float snapshot.kt | 10 +- ...ration with static arg integer snapshot.kt | 10 +- ...n with static arg object array snapshot.kt | 24 +++- ...dration with static arg object snapshot.kt | 14 +- ...sic hydration with static args snapshot.kt | 10 +- ... instruction hook returns null snapshot.kt | 23 +++- ...h hydration null source object snapshot.kt | 12 +- ...ation with renamed actor field snapshot.kt | 14 +- ...n query with a synthetic field snapshot.kt | 27 +++- ... default array argument values snapshot.kt | 35 ++++- ...efault boolean argument values snapshot.kt | 29 ++++- ...th default int argument values snapshot.kt | 29 ++++- ...h default null argument values snapshot.kt | 29 ++++- ...default object argument values snapshot.kt | 33 ++++- ...default string argument values snapshot.kt | 29 ++++- .../batching of hydration list snapshot.kt | 27 +++- ... list with flattened arguments snapshot.kt | 27 +++- ... hydration list with partition snapshot.kt | 38 ++++-- .../batching absent source input snapshot.kt | 24 +++- ...dition after a false condition snapshot.kt | 13 +- ...nal hydration in abstract type snapshot.kt | 40 ++++-- ...tion with list condition field snapshot.kt | 12 +- ...le true conditions takes first snapshot.kt | 13 +- ... hydration works with int type snapshot.kt | 12 +- ...n works with matches condition snapshot.kt | 13 +- ...orks with startsWith condition snapshot.kt | 13 +- ...ds going to different services snapshot.kt | 30 ++++- .../batching no source inputs snapshot.kt | 26 +++- .../batching single source id snapshot.kt | 26 +++- ...hydration for specific service snapshot.kt | 14 +- ...ration name on batch hydration snapshot.kt | 14 +- ...cy operation name on hydration snapshot.kt | 10 +- ...the inputIdentifiedBy argument snapshot.kt | 27 +++- ...on batching returns null batch snapshot.kt | 14 +- .../complex identified by snapshot.kt | 46 ++++++- ...r hydrations and a deep rename snapshot.kt | 50 ++++++-- ...ses same source for hydrations snapshot.kt | 50 ++++++-- ...fied by with indexed hydration snapshot.kt | 27 +++- ...ntified by with list source id snapshot.kt | 46 ++++++- ...d by with some null source ids snapshot.kt | 38 +++++- ... object with indexed hydration snapshot.kt | 27 +++- ...dicate works with integer type snapshot.kt | 10 +- ...s predicate works with id type snapshot.kt | 10 +- ...h predicate works with id type snapshot.kt | 10 +- ...d argument passed to hydration snapshot.kt | 24 +++- ... passed to synthetic hydration snapshot.kt | 24 +++- ...ydration batching returns null snapshot.kt | 14 +- .../hydration call forwards error snapshot.kt | 10 +- ...over itself with renamed types snapshot.kt | 14 +- ...e from original field argument snapshot.kt | 13 +- ...rated part and synthetic field snapshot.kt | 25 +++- ...fragments in the hydrated part snapshot.kt | 25 +++- ... from original field arguments snapshot.kt | 14 +- ...ration from field in interface snapshot.kt | 20 ++- ... in interface with type rename snapshot.kt | 20 ++- ...dration inside a renamed field snapshot.kt | 10 +- .../hydration list input snapshot.kt | 30 +++-- ...t with batching forwards error snapshot.kt | 14 +- .../hydration list with batching snapshot.kt | 14 +- ...ydration list with one element snapshot.kt | 10 +- ...ith interfaces asking typename snapshot.kt | 8 +- .../hydration with interfaces snapshot.kt | 8 +- ...hydration with more interfaces snapshot.kt | 16 ++- ...tions ignores false conditions snapshot.kt | 10 +- ...le true conditions takes first snapshot.kt | 10 +- ...ithin hydration with variables snapshot.kt | 21 ++- ...ncestor field has been renamed snapshot.kt | 10 +- .../index hydration all null ids snapshot.kt | 10 +- ...ration with partitioned inputs snapshot.kt | 38 ++++-- ...index one batch returns errors snapshot.kt | 25 +++- ...g using index returning errors snapshot.kt | 13 +- ... index returning null elements snapshot.kt | 13 +- ...ing using index returning null snapshot.kt | 13 +- ...hydration matching using index snapshot.kt | 13 +- ...atching using index with lists snapshot.kt | 13 +- ...th hydration field not exposed snapshot.kt | 13 +- ...ng index with null input nodes snapshot.kt | 13 +- ...s with different source fields snapshot.kt | 10 +- ...nder a renamed top level field snapshot.kt | 30 +++-- ...ith null value in source array snapshot.kt | 23 +++- ...ument for hydration is missing snapshot.kt | 20 ++- ...on call with fragments defined snapshot.kt | 10 +- ...input value having longer path snapshot.kt | 10 +- ...th arguments and merged fields snapshot.kt | 13 +- ...on call with variables defined snapshot.kt | 10 +- ...merged fields and renamed type snapshot.kt | 13 +- ...types implement same interface snapshot.kt | 26 +++- ...fields are in the same service snapshot.kt | 26 +++- ...hydration return null in array snapshot.kt | 26 +++- ...eturn null in array with error snapshot.kt | 26 +++- ...eturn top level null and error snapshot.kt | 26 +++- ...ydration return top level null snapshot.kt | 26 +++- .../batch polymorphic hydration snapshot.kt | 26 +++- ...dration when hook returns null snapshot.kt | 25 +++- ...where only one type is queried snapshot.kt | 27 +++- ...phic hydration with conditions snapshot.kt | 26 +++- ...phic hydration with interfaces snapshot.kt | 27 +++- ...hydration with lots of renames snapshot.kt | 26 +++- ...ymorphic hydration with rename snapshot.kt | 26 +++- ...ymorphic hydration with unions snapshot.kt | 27 +++- ...tions are executed in parallel snapshot.kt | 26 +++- ...tructions use different inputs snapshot.kt | 41 ++++-- ...solitary polymorphic hydration snapshot.kt | 20 ++- ...dration when hook returns null snapshot.kt | 10 +- ...ed interfaces work as expected snapshot.kt | 30 +++-- ...rs are reflected in the result snapshot.kt | 10 +- ...rs are reflected in the result snapshot.kt | 10 +- ...imple data and lots of renames snapshot.kt | 36 ++++-- ...ted hydrations and simple data snapshot.kt | 36 ++++-- ...ydrations and synthetic fields snapshot.kt | 50 ++++++-- ...y with three nested hydrations snapshot.kt | 50 ++++++-- ...y using same underlying source snapshot.kt | 10 +- ...verlapping fields in the query snapshot.kt | 10 +- ...rated fields on the same level snapshot.kt | 10 +- ...vel when using batch hydration snapshot.kt | 12 +- .../same source for hydrations snapshot.kt | 20 ++- ...nested hydrations and a rename snapshot.kt | 20 ++- ...n query with a synthetic field snapshot.kt | 10 +- ... one service and type renaming snapshot.kt | 10 +- ...ydration batching returns null snapshot.kt | 14 +- ...er itself within renamed types snapshot.kt | 14 +- ... from original field arguments snapshot.kt | 14 +- ...hetic hydration forwards error snapshot.kt | 10 +- ...t with batching forwards error snapshot.kt | 14 +- ...ic hydration with renamed type snapshot.kt | 10 +- ...ncestor field has been renamed snapshot.kt | 10 +- ...in batched synthetic hydration snapshot.kt | 27 +++- ...ns null in synthetic hydration snapshot.kt | 10 +- ...in batched synthetic hydration snapshot.kt | 27 +++- ...is null in synthetic hydration snapshot.kt | 10 +- ...ransformer on hydration fields snapshot.kt | 10 +- .../legacy/oneOf/oneOf successful snapshot.kt | 12 +- ...face fields get typename added snapshot.kt | 10 +- ...are renamed get typename added snapshot.kt | 10 +- ...ename in them work as expected snapshot.kt | 20 ++- ...ename in them work as expected snapshot.kt | 20 ++- ... in fragments work as expected snapshot.kt | 10 +- ... in fragments work as expected snapshot.kt | 20 ++- ...ename in them work as expected snapshot.kt | 20 ++- .../chain rename transform snapshot.kt | 13 +- ...ame transform with type rename snapshot.kt | 13 +- .../rename inside hydration snapshot.kt | 10 +- ...ame inside multiple hydrations snapshot.kt | 20 ++- ...rename on shared abstract type snapshot.kt | 10 +- ... top level field with argument snapshot.kt | 10 +- ...ed type inside batch hydration snapshot.kt | 14 +- ...enamed type inside deep rename snapshot.kt | 10 +- ... deep rename that returns null snapshot.kt | 10 +- .../renamed type inside hydration snapshot.kt | 10 +- ...de hydration that returns null snapshot.kt | 10 +- ...d fragments with renamed types snapshot.kt | 10 +- ...types rename works as expected snapshot.kt | 12 +- ...o multiple services are merged snapshot.kt | 30 +++-- ...date time scalar as input type snapshot.kt | 10 +- .../scalars/hydrating json data snapshot.kt | 10 +- ...drating using date time as arg snapshot.kt | 10 +- .../hydrating using long as arg snapshot.kt | 10 +- .../hydrating using url as arg snapshot.kt | 10 +- ...r argument with default values snapshot.kt | 8 +- .../long scalar as input type snapshot.kt | 10 +- .../url scalar as input type snapshot.kt | 10 +- ...ive field with hydrated parent snapshot.kt | 10 +- ...eld with batch hydrated parent snapshot.kt | 13 +- .../nadel/tests/next/NadelIntegrationTest.kt | 29 ++--- .../nadel/tests/next/TestExecutionCapture.kt | 15 +-- .../basic/BasicObjectSchemaTestSnapshot.kt | 10 +- .../basic/HiddenFieldHintOnSnapshot.kt | 10 +- .../BatchHydrationAtQueryTypeTestSnapshot.kt | 17 ++- .../BatchRootFieldsByShardTestSnapshot.kt | 23 +++- .../ServiceExecutionContextTestSnapshot.kt | 20 ++- ...ongInputToStringForMatchingTestSnapshot.kt | 14 +- .../HydrationAtQueryTypeTestSnapshot.kt | 12 +- ...ionIdentifiedByRenamedFieldTestSnapshot.kt | 21 ++- ...ltipleNestedSourceArgumentsTestSnapshot.kt | 22 +++- .../HydrationNestedObjectInputTestSnapshot.kt | 21 ++- ...eSourceArgumentsConditionalTestSnapshot.kt | 55 +++++--- ...HydrationRemainingArgumentsTestSnapshot.kt | 29 +++-- .../hydration/HydrationTestSnapshot.kt | 24 ++-- .../HydrationThrowsErrorTestSnapshot.kt | 14 +- ...ionDuplicateDefaultHydratedTestSnapshot.kt | 14 +- ...ionCommonInterfaceMigrationTestSnapshot.kt | 12 +- ...lymorphicHydrationMigrationTestSnapshot.kt | 72 ++++++++--- ...ionConditionalEnumConditionTestSnapshot.kt | 13 +- ...ConditionalBooleanConditionTestSnapshot.kt | 10 +- ...ionConditionalEnumConditionTestSnapshot.kt | 14 +- ...ionalMultipleEnumConditionsTestSnapshot.kt | 10 +- .../defer/DeferGroupingTestSnapshot.kt | 12 +- .../HydrationDeferFlagOffTestSnapshot.kt | 24 ++-- ...ardsErrorsFromEachHydrationTestSnapshot.kt | 48 +++++-- ...ydrationDeferForwardsErrorsTestSnapshot.kt | 22 +++- .../HydrationDeferGroupingTestSnapshot.kt | 22 +++- .../HydrationDeferInListNestedTestSnapshot.kt | 22 +++- .../defer/HydrationDeferInListTestSnapshot.kt | 36 ++++-- ...ydrationDeferInListTopLevelTestSnapshot.kt | 44 +++++-- ...ionDeferInListTwoDimensionsTestSnapshot.kt | 44 +++++-- ...medFieldAndNestedHydrationsTestSnapshot.kt | 60 ++++++--- ...ydrationDeferInRenamedFieldTestSnapshot.kt | 24 ++-- ...namedFieldUsingRenamedFieldTestSnapshot.kt | 24 ++-- ...DeferInlineFragmentGroupingTestSnapshot.kt | 22 +++- ...DisabledForNestedHydrationsTestSnapshot.kt | 34 +++-- .../defer/HydrationDeferLabelTestSnapshot.kt | 24 ++-- .../defer/HydrationDeferTestSnapshot.kt | 24 ++-- ...ydrationRenamedFieldInDeferTestSnapshot.kt | 24 ++-- ...NestedHydrationsInsideDeferTestSnapshot.kt | 60 ++++++--- .../batch/BatchHydrationDeferTestSnapshot.kt | 20 ++- ...atchHydrationDeferWithLabelTestSnapshot.kt | 22 +++- .../idHydration/IdHydrationTestSnapshot.kt | 38 ++++-- ...tionAndPolymorphicHydrationTestSnapshot.kt | 44 +++++-- .../StaticHydrationNestedErrorTestSnapshot.kt | 12 +- ...drationOverlappingHydrationTestSnapshot.kt | 57 ++++++--- .../StaticHydrationScalarFieldTestSnapshot.kt | 9 +- .../statics/StaticHydrationTestSnapshot.kt | 26 ++-- ...HydrationVirtualTypeHintOffTestSnapshot.kt | 10 +- .../ErrorOnPartitionCallsTestSnapshot.kt | 52 ++++++-- .../ErrorOnPrimaryCallTestSnapshot.kt | 52 ++++++-- ...ydrationFollowedByPartitionTestSnapshot.kt | 26 +++- .../MutationPartitionTestSnapshot.kt | 76 ++++++++--- ...FetcherErrorInPartitionCallTestSnapshot.kt | 76 ++++++++--- ...taFetcherErrorInPrimaryCallTestSnapshot.kt | 76 ++++++++--- ...tionPartitionWithErrorsOnlyTestSnapshot.kt | 76 ++++++++--- ...utationErrorInPartitionCallTestSnapshot.kt | 76 ++++++++--- ...hMutationErrorInPrimaryCallTestSnapshot.kt | 76 ++++++++--- .../NamespacedPartitionTestSnapshot.kt | 38 +++++- .../partition/NestedPartitionTestSnapshot.kt | 38 +++++- .../partition/NoPartitionTestSnapshot.kt | 19 ++- .../partition/PartialPartitionTestSnapshot.kt | 29 ++++- ...artitionFollowedByHydrationTestSnapshot.kt | 120 +++++++++++++----- .../PartitionFollowedByRenamedTestSnapshot.kt | 60 ++++++--- ...peWithMultipleRoutingFieldsTestSnapshot.kt | 42 +++++- ...outingValuesThatAreFilteredTestSnapshot.kt | 50 ++++++-- .../PartitionWithFieldAliasTestSnapshot.kt | 52 ++++++-- ...tionWithNamespaceFieldAliasTestSnapshot.kt | 52 ++++++-- .../PartitionWithSkipIncludeTestSnapshot.kt | 52 ++++++-- .../PartitionWithTypeNameTestSnapshot.kt | 52 ++++++-- .../PartitionWithVariablesTestSnapshot.kt | 52 ++++++-- .../partition/SimplePartitionTestSnapshot.kt | 52 ++++++-- .../fixtures/rename/RenamedInputTypeTest.kt | 11 +- .../rename/RenamedScalarInputTypeTest.kt | 6 - .../rename/RenamedSharedInputTypeTest.kt | 11 +- .../CustomHydrationDirectiveTestSnapshot.kt | 55 +++++--- ...tubFieldInMutationOperationTestSnapshot.kt | 12 +- .../StubFieldInMutationPayloadTestSnapshot.kt | 12 +- ...ll-with-variables-inside-input-objects.yml | 6 +- ...ri-argument-transform-on-renamed-field.yml | 6 +- .../ari use case/ari-argument-transform.yml | 6 +- ...ame-inside-batch-hydration-null-object.yml | 10 +- .../deep-rename-inside-batch-hydration.yml | 10 +- .../deep-rename-inside-hydration.yml | 10 +- .../deep-rename-inside-hydrations.yml | 22 ++-- .../deep-rename-with-argument-works.yml | 6 +- ...ents-with-mixed-literals-and-variables.yml | 11 +- ...named-field-input-is-wrapped-in-a-list.yml | 11 +- ...lined-all-arguments-with-renamed-field.yml | 11 +- .../inlined-json-arguments.yml | 13 +- .../input-object-with-json-field.yml | 8 +- .../primitive-json-arguments-variables.yml | 8 +- .../primitive-json-arguments.yml | 8 +- ...e-resolution-handles-complex-fragments.yml | 6 +- ...nline-fragments-from-multiple-services.yml | 6 +- ...services-with-one-unmapped-node-lookup.yml | 6 +- ...c-service-resolution-multiple-services.yml | 12 +- ...service-resolution-simple-success-case.yml | 6 +- ...c-service-resolution-with-no-fragments.yml | 6 +- ...ueries-using-dynamic-resolved-services.yml | 6 +- ...vice-is-possible-with-synthetic-fields.yml | 6 +- ...types-from-another-service-is-possible.yml | 6 +- ...s-via-hydration-returning-a-connection.yml | 12 +- ...via-hydration-with-arguments-passed-on.yml | 6 +- ...via-hydration-with-variables-arguments.yml | 6 +- ...d-hydration-top-level-field-is-removed.yml | 6 +- .../hydration-top-level-field-is-removed.yml | 6 +- ...d-hydration-top-level-field-is-removed.yml | 6 +- ...s-not-removed-short-circuit-hint-is-on.yml | 6 +- .../graphqlcontext-is-present-on-input.yml | 6 +- ...n.yml => introspection-with-variables.yml} | 2 +- .../java-compat/java-ari-transform.yml | 6 +- ...and-use-same-field-as-hydration-source.yml | 16 +-- ...he-result-are-backed-a-batch-hydration.yml | 8 +- ...s-in-the-result-are-backed-a-hydration.yml | 14 +- ...he-result-are-backed-a-batch-hydration.yml | 8 +- ...s-in-the-result-are-backed-a-hydration.yml | 22 ++-- ...dration-fields-are-seen-by-transformer.yml | 10 +- ...l-hydration-with-true-equals-condition.yml | 12 +- ...-hydration-with-true-matches-condition.yml | 12 +- ...ration-with-true-starts-with-condition.yml | 12 +- .../basic-hydration-directive-based.yml | 10 +- ...asic-hydration-with-actor-field-rename.yml | 10 +- ...ion-with-default-array-argument-values.yml | 10 +- ...n-with-default-boolean-argument-values.yml | 10 +- ...ation-with-default-int-argument-values.yml | 10 +- ...tion-with-default-null-argument-values.yml | 10 +- ...on-with-default-object-argument-values.yml | 10 +- ...on-with-default-string-argument-values.yml | 10 +- .../basic-hydration-with-static-arg-array.yml | 10 +- ...asic-hydration-with-static-arg-boolean.yml | 6 +- .../basic-hydration-with-static-arg-float.yml | 6 +- ...asic-hydration-with-static-arg-integer.yml | 6 +- ...hydration-with-static-arg-object-array.yml | 23 +--- ...basic-hydration-with-static-arg-object.yml | 13 +- .../basic-hydration-with-static-args.yml | 6 +- .../new hydration/basic-hydration.yml | 10 +- ...ydration-instruction-hook-returns-null.yml | 26 ++-- .../batch-hydration-null-source-object.yml | 8 +- ...tch-hydration-with-renamed-actor-field.yml | 10 +- ...hydration-query-with-a-synthetic-field.yml | 16 +-- ...ion-with-default-array-argument-values.yml | 16 +-- ...n-with-default-boolean-argument-values.yml | 16 +-- ...ation-with-default-int-argument-values.yml | 16 +-- ...tion-with-default-null-argument-values.yml | 16 +-- ...on-with-default-object-argument-values.yml | 16 +-- ...on-with-default-string-argument-values.yml | 16 +-- ...ydration-list-with-flattened-arguments.yml | 16 +-- ...ing-of-hydration-list-with-partition-2.yml | 12 +- ...ching-of-hydration-list-with-partition.yml | 22 ++-- .../batching-of-hydration-list.yml | 16 +-- .../batching/batching-absent-source-input.yml | 12 +- ...true-condition-after-a-false-condition.yml | 12 +- ...conditional-hydration-in-abstract-type.yml | 20 +-- ...al-hydration-with-list-condition-field.yml | 12 +- ...h-multiple-true-conditions-takes-first.yml | 12 +- ...ditional-hydration-works-with-int-type.yml | 12 +- ...hydration-works-with-matches-condition.yml | 12 +- ...ation-works-with-starts-with-condition.yml | 12 +- ...source-ids-going-to-different-services.yml | 14 +- .../batching/batching-no-source-inputs.yml | 14 +- .../batching/batching-single-source-id.yml | 14 +- ...n-batch-hydration-for-specific-service.yml | 10 +- ...gacy-operation-name-on-batch-hydration.yml | 8 +- ...ate-legacy-operation-name-on-hydration.yml | 8 +- ...ds-in-the-input-identified-by-argument.yml | 8 +- ...-hydration-batching-returns-null-batch.yml | 10 +- ...rce-for-2-hydrations-and-a-deep-rename.yml | 28 ++-- ...d-by-uses-same-source-for-2-hydrations.yml | 28 ++-- ...x-identified-by-with-indexed-hydration.yml | 8 +- ...plex-identified-by-with-list-source-id.yml | 16 +-- .../complex-identified-by-with-rename.yml | 26 +--- ...dentified-by-with-some-null-source-ids.yml | 16 +-- .../complex-identified-by.yml | 20 +-- ...ex-input-object-with-indexed-hydration.yml | 8 +- ...uals-predicate-works-with-integer-type.yml | 12 +- ...n-matches-predicate-works-with-id-type.yml | 12 +- ...arts-with-predicate-works-with-id-type.yml | 12 +- ...ive-field-argument-passed-to-hydration.yml | 12 +- ...argument-passed-to-synthetic-hydration.yml | 12 +- .../hydration-batching-returns-null.yml | 10 +- .../hydration-call-forwards-error.yml | 10 +- ...on-call-over-itself-with-renamed-types.yml | 10 +- ...ent-value-from-original-field-argument.yml | 10 +- ...-the-hydrated-part-and-synthetic-field.yml | 16 +-- ...ll-with-fragments-in-the-hydrated-part.yml | 16 +-- ...t-values-from-original-field-arguments.yml | 10 +- ...om-field-in-interface-with-type-rename.yml | 12 +- .../hydration-from-field-in-interface.yml | 12 +- .../hydration-inside-a-renamed-field.yml | 10 +- .../new hydration/hydration-list-input.yml | 22 ++-- ...tion-list-with-batching-forwards-error.yml | 10 +- .../hydration-list-with-batching.yml | 10 +- .../hydration-list-with-one-element.yml | 10 +- ...ration-with-interfaces-asking-typename.yml | 10 +- .../hydration-with-interfaces.yml | 10 +- .../hydration-with-more-interfaces.yml | 16 +-- ...le-conditions-ignores-false-conditions.yml | 12 +- ...h-multiple-true-conditions-takes-first.yml | 12 +- ...ration-within-hydration-with-variables.yml | 16 +-- ...hen-an-ancestor-field-has-been-renamed.yml | 10 +- .../index-hydration-all-null-ids.yml | 11 +- ...ndex-hydration-with-partitioned-inputs.yml | 22 ++-- ...g-using-index-one-batch-returns-errors.yml | 16 +-- ...g-index-result-size-invariant-mismatch.yml | 6 +- ...-matching-using-index-returning-errors.yml | 10 +- ...ng-using-index-returning-null-elements.yml | 10 +- ...on-matching-using-index-returning-null.yml | 10 +- ...lists-with-hydration-field-not-exposed.yml | 10 +- ...ration-matching-using-index-with-lists.yml | 10 +- ...hing-using-index-with-null-input-nodes.yml | 10 +- .../index/hydration-matching-using-index.yml | 10 +- ...ydrations-with-different-source-fields.yml | 12 +- ...ration-under-a-renamed-top-level-field.yml | 22 ++-- ...atched-with-null-value-in-source-array.yml | 26 ++-- ...able-argument-for-hydration-is-missing.yml | 16 +-- ...-hydration-call-with-fragments-defined.yml | 10 +- ...ll-with-input-value-having-longer-path.yml | 10 +- ...nger-path-and-same-named-overall-field.yml | 6 +- ...onger-path-arguments-and-merged-fields.yml | 10 +- ...-hydration-call-with-variables-defined.yml | 10 +- ...nger-path-and-same-named-overall-field.yml | 6 +- ...nts-and-merged-fields-and-renamed-type.yml | 10 +- ...-return-types-implement-same-interface.yml | 16 +-- ...n-actor-fields-are-in-the-same-service.yml | 16 +-- ...ration-return-null-in-array-with-error.yml | 69 +++++----- ...morphic-hydration-return-null-in-array.yml | 16 +-- ...ration-return-top-level-null-and-error.yml | 59 ++++----- ...orphic-hydration-return-top-level-null.yml | 49 +++---- ...hic-hydration-when-hook-returns-null-1.yml | 12 +- ...rphic-hydration-when-hook-returns-null.yml | 6 +- ...dration-where-only-one-type-is-queried.yml | 16 +-- ...-polymorphic-hydration-with-conditions.yml | 16 +-- ...-polymorphic-hydration-with-interfaces.yml | 16 +-- ...morphic-hydration-with-lots-of-renames.yml | 16 +-- ...atch-polymorphic-hydration-with-rename.yml | 16 +-- ...atch-polymorphic-hydration-with-unions.yml | 16 +-- .../batch-polymorphic-hydration.yml | 16 +-- ...ic-hydrations-are-executed-in-parallel.yml | 16 +-- ...tion-instructions-use-different-inputs.yml | 18 +-- ...rphic-hydration-when-hook-returns-null.yml | 6 +- .../solitary-polymorphic-hydration.yml | 12 +- ...h-hydrated-interfaces-work-as-expected.yml | 18 +-- ...ith-errors-are-reflected-in-the-result.yml | 10 +- ...ith-errors-are-reflected-in-the-result.yml | 10 +- ...ns-and-simple-data-and-lots-of-renames.yml | 22 ++-- ...hree-nested-hydrations-and-simple-data.yml | 22 ++-- ...nested-hydrations-and-synthetic-fields.yml | 28 ++-- .../query-with-three-nested-hydrations.yml | 28 ++-- ...ted-query-using-same-underlying-source.yml | 10 +- ...-level-overlapping-fields-in-the-query.yml | 6 +- ...-same-level-when-using-batch-hydration.yml | 10 +- ...ated-hydrated-fields-on-the-same-level.yml | 10 +- .../same-source-for-2-hydrations.yml | 12 +- ...e-for-2-nested-hydrations-and-a-rename.yml | 12 +- ...hydration-query-with-a-synthetic-field.yml | 10 +- ...ion-with-one-service-and-type-renaming.yml | 10 +- ...thetic-hydration-batching-returns-null.yml | 10 +- ...-call-over-itself-within-renamed-types.yml | 10 +- ...t-values-from-original-field-arguments.yml | 10 +- .../synthetic-hydration-forwards-error.yml | 10 +- ...tion-list-with-batching-forwards-error.yml | 10 +- .../synthetic-hydration-with-renamed-type.yml | 10 +- ...hen-an-ancestor-field-has-been-renamed.yml | 10 +- ...ns-null-in-batched-synthetic-hydration.yml | 16 +-- ...ta-returns-null-in-synthetic-hydration.yml | 10 +- ...is-null-in-batched-synthetic-hydration.yml | 16 +-- ...l-field-is-null-in-synthetic-hydration.yml | 10 +- .../transformer-on-hydration-fields.yml | 10 +- .../fixtures/oneOf/one-of-successful.yml | 6 +- ...el-interface-fields-get-typename-added.yml | 6 +- ...s-which-are-renamed-get-typename-added.yml | 6 +- ...have-typename-in-them-work-as-expected.yml | 12 +- ...typename-in-fragments-work-as-expected.yml | 6 +- ...ixed-typename-in-them-work-as-expected.yml | 12 +- ...typename-in-fragments-work-as-expected.yml | 12 +- ...have-typename-in-them-work-as-expected.yml | 12 +- ...hain-rename-transform-with-type-rename.yml | 10 +- .../renames/chain-rename-transform.yml | 10 +- .../renames/rename-inside-hydration.yml | 10 +- .../rename-inside-multiple-hydrations.yml | 16 +-- .../rename-on-shared-abstract-type.yml | 6 +- .../renamed-top-level-field-with-argument.yml | 6 +- .../renamed-type-inside-batch-hydration.yml | 10 +- ...e-inside-deep-rename-that-returns-null.yml | 6 +- .../types/renamed-type-inside-deep-rename.yml | 6 +- ...ype-inside-hydration-that-returns-null.yml | 10 +- .../types/renamed-type-inside-hydration.yml | 10 +- .../repeated-fragments-with-renamed-types.yml | 6 +- ...d-input-types-rename-works-as-expected.yml | 6 +- .../calls-to-multiple-services-are-merged.yml | 18 +-- .../date-time-scalar-as-input-type.yml | 6 +- .../fixtures/scalars/hydrating-json-data.yml | 11 +- .../hydrating-using-date-time-as-arg.yml | 10 +- .../scalars/hydrating-using-long-as-arg.yml | 10 +- .../scalars/hydrating-using-url-as-arg.yml | 10 +- ...ng-scalar-argument-with-default-values.yml | 6 +- .../scalars/long-scalar-as-input-type.yml | 6 +- .../scalars/url-scalar-as-input-type.yml | 6 +- ...e-directive-field-with-hydrated-parent.yml | 6 +- ...ve-on-field-with-batch-hydrated-parent.yml | 6 +- 532 files changed, 6271 insertions(+), 3129 deletions(-) delete mode 100644 lib/src/main/java/graphql/nadel/hints/AllDocumentVariablesHint.kt create mode 100644 test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt create mode 100644 test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt delete mode 100644 test/src/test/kotlin/graphql/nadel/tests/hooks/`introspection-with-variables-ff-on`.kt rename test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/{introspection with variables FF on snapshot.kt => introspection with variables snapshot.kt} (95%) rename test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/{introspection with variables FF on.kt => introspection with variables.kt} (95%) rename test/src/test/resources/fixtures/introspection/{introspection-with-variables-ff-on.yml => introspection-with-variables.yml} (96%) diff --git a/lib/src/main/java/graphql/nadel/NadelExecutionHints.kt b/lib/src/main/java/graphql/nadel/NadelExecutionHints.kt index 82f15fc7a..06f73decc 100644 --- a/lib/src/main/java/graphql/nadel/NadelExecutionHints.kt +++ b/lib/src/main/java/graphql/nadel/NadelExecutionHints.kt @@ -1,6 +1,5 @@ package graphql.nadel -import graphql.nadel.hints.AllDocumentVariablesHint import graphql.nadel.hints.LegacyOperationNamesHint import graphql.nadel.hints.NadelBatchRootFieldsHint import graphql.nadel.hints.NadelDeferSupportHint @@ -18,7 +17,6 @@ import graphql.nadel.hints.NewResultMergerAndNamespacedTypename data class NadelExecutionHints( val legacyOperationNames: LegacyOperationNamesHint, - val allDocumentVariablesHint: AllDocumentVariablesHint, val newResultMergerAndNamespacedTypename: NewResultMergerAndNamespacedTypename, val deferSupport: NadelDeferSupportHint, val sharedTypeRenames: NadelSharedTypeRenamesHint, @@ -45,7 +43,6 @@ data class NadelExecutionHints( class Builder { private var legacyOperationNames = LegacyOperationNamesHint { false } - private var allDocumentVariablesHint = AllDocumentVariablesHint { false } private var newResultMergerAndNamespacedTypename = NewResultMergerAndNamespacedTypename { false } private var deferSupport = NadelDeferSupportHint { false } private var shortCircuitEmptyQuery = NadelShortCircuitEmptyQueryHint { false } @@ -64,7 +61,6 @@ data class NadelExecutionHints( constructor(nadelExecutionHints: NadelExecutionHints) { legacyOperationNames = nadelExecutionHints.legacyOperationNames - allDocumentVariablesHint = nadelExecutionHints.allDocumentVariablesHint newResultMergerAndNamespacedTypename = nadelExecutionHints.newResultMergerAndNamespacedTypename deferSupport = nadelExecutionHints.deferSupport shortCircuitEmptyQuery = nadelExecutionHints.shortCircuitEmptyQuery @@ -85,11 +81,6 @@ data class NadelExecutionHints( return this } - fun allDocumentVariablesHint(flag: AllDocumentVariablesHint): Builder { - allDocumentVariablesHint = flag - return this - } - fun newResultMergerAndNamespacedTypename(flag: NewResultMergerAndNamespacedTypename): Builder { newResultMergerAndNamespacedTypename = flag return this @@ -158,7 +149,6 @@ data class NadelExecutionHints( fun build(): NadelExecutionHints { return NadelExecutionHints( legacyOperationNames, - allDocumentVariablesHint, newResultMergerAndNamespacedTypename, deferSupport, sharedTypeRenames, diff --git a/lib/src/main/java/graphql/nadel/NextgenEngine.kt b/lib/src/main/java/graphql/nadel/NextgenEngine.kt index 18e2934de..c5b225073 100644 --- a/lib/src/main/java/graphql/nadel/NextgenEngine.kt +++ b/lib/src/main/java/graphql/nadel/NextgenEngine.kt @@ -56,7 +56,6 @@ import graphql.nadel.util.OperationNameUtil import graphql.nadel.validation.NadelSchemaValidation import graphql.normalized.ExecutableNormalizedField import graphql.normalized.ExecutableNormalizedOperationFactory.createExecutableNormalizedOperationWithRawVariables -import graphql.normalized.VariablePredicate import graphql.schema.GraphQLSchema import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -384,15 +383,13 @@ internal class NextgenEngine( val executionInput = executionContext.executionInput - val jsonPredicate: VariablePredicate = getDocumentVariablePredicate(executionContext.hints, service) - val compileResult = timer.time(step = DocumentCompilation) { compileToDocument( schema = service.underlyingSchema, operationKind = topLevelFields.first().getOperationKind(engineSchema), operationName = getOperationName(service, executionContext), topLevelFields = topLevelFields, - variablePredicate = jsonPredicate, + variablePredicate = DocumentPredicates.allVariablesPredicate, deferSupport = executionContext.hints.deferSupport(), forcePrintBareFields = forcePrintBareFields, ) @@ -498,14 +495,6 @@ internal class NextgenEngine( && topLevelField.children.all { it.name == TypeNameMetaFieldDef.name } } - private fun getDocumentVariablePredicate(hints: NadelExecutionHints, service: Service): VariablePredicate { - return if (hints.allDocumentVariablesHint.invoke(service)) { - DocumentPredicates.allVariablesPredicate - } else { - DocumentPredicates.jsonPredicate - } - } - private fun getOperationName(service: Service, executionContext: NadelExecutionContext): String? { val originalOperationName = executionContext.query.operationName return if (executionContext.hints.legacyOperationNames(service)) { diff --git a/lib/src/main/java/graphql/nadel/engine/document/DocumentPredicates.kt b/lib/src/main/java/graphql/nadel/engine/document/DocumentPredicates.kt index 3684ff2c1..dd2758a0e 100644 --- a/lib/src/main/java/graphql/nadel/engine/document/DocumentPredicates.kt +++ b/lib/src/main/java/graphql/nadel/engine/document/DocumentPredicates.kt @@ -5,14 +5,6 @@ import graphql.normalized.VariablePredicate class DocumentPredicates { companion object { - /** - * A predicate that causes JSON arguments to be compiled as variables - */ - val jsonPredicate = - VariablePredicate { _, _, normalizedInputValue -> - "JSON" == normalizedInputValue.unwrappedTypeName && normalizedInputValue.value != null - } - /** * A predicate that causes ALL arguments to be compiled as variables */ diff --git a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt index e17fdbeb8..68410297a 100644 --- a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt +++ b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt @@ -124,7 +124,7 @@ internal class NadelHydrationInputBuilder private constructor( inputDef: NadelHydrationArgument, ): NormalizedInputValue? { return when (val valueSource = inputDef.valueSource) { - is ValueSource.ArgumentValue -> getArgumentValue(valueSource) + is ValueSource.ArgumentValue -> getArgumentValue(inputDef, valueSource) is ValueSource.FieldResultValue -> makeInputValue( inputDef, value = getResultValue(valueSource), @@ -162,9 +162,16 @@ internal class NadelHydrationInputBuilder private constructor( } private fun getArgumentValue( + inputDef: NadelHydrationArgument, valueSource: ValueSource.ArgumentValue, ): NormalizedInputValue? { - return virtualField.getNormalizedArgument(valueSource.argumentName) ?: valueSource.defaultValue + val argumentValue = virtualField.getNormalizedArgument(valueSource.argumentName) ?: valueSource.defaultValue + return argumentValue?.let { + NormalizedInputValue( + GraphQLTypeUtil.simplePrint(inputDef.backingArgumentDef.type), + it.value, + ) + } } private fun getResultValue( diff --git a/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt b/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt index 9e1c563ce..4cbc206fc 100644 --- a/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt +++ b/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt @@ -30,7 +30,10 @@ internal object NadelBatchHydrationInputBuilder { virtualField.normalizedArguments[valueSource.argumentName] ?: valueSource.defaultValue if (argValue != null) { - argument to argValue + argument to NormalizedInputValue( + GraphQLTypeUtil.simplePrint(argument.backingArgumentDef.type), + argValue.value, + ) } else { null } diff --git a/lib/src/main/java/graphql/nadel/hints/AllDocumentVariablesHint.kt b/lib/src/main/java/graphql/nadel/hints/AllDocumentVariablesHint.kt deleted file mode 100644 index 4d0779257..000000000 --- a/lib/src/main/java/graphql/nadel/hints/AllDocumentVariablesHint.kt +++ /dev/null @@ -1,13 +0,0 @@ -package graphql.nadel.hints - -import graphql.nadel.Service - -fun interface AllDocumentVariablesHint { - /** - * Determines whether to use all variables for arguments in the document sent to a service - * - * @param service the service in question - * @return true to use all variables - */ - operator fun invoke(service: Service): Boolean -} diff --git a/lib/src/test/kotlin/graphql/nadel/archunit/NadelPrefixTest.kt b/lib/src/test/kotlin/graphql/nadel/archunit/NadelPrefixTest.kt index 8e7cde90d..b956a1171 100644 --- a/lib/src/test/kotlin/graphql/nadel/archunit/NadelPrefixTest.kt +++ b/lib/src/test/kotlin/graphql/nadel/archunit/NadelPrefixTest.kt @@ -67,7 +67,6 @@ class NadelPrefixTest { "graphql.nadel.engine.transform.result.json.JsonNodeExtractor", "graphql.nadel.engine.transform.result.json.JsonNodes", "graphql.nadel.engine.util.AliasesKt", - "graphql.nadel.hints.AllDocumentVariablesHint", "graphql.nadel.hints.LegacyOperationNamesHint", "graphql.nadel.hints.NewBatchHydrationGroupingHint", "graphql.nadel.hints.NewResultMergerAndNamespacedTypename", diff --git a/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt b/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt index fa855da31..a3d94aa5a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt @@ -5,8 +5,6 @@ import graphql.GraphQLError import graphql.incremental.DeferPayload import graphql.incremental.DelayedIncrementalPartialResult import graphql.incremental.DelayedIncrementalPartialResultImpl.newIncrementalExecutionResult -import graphql.language.AstPrinter -import graphql.language.AstSorter import graphql.nadel.Nadel import graphql.nadel.NadelExecutionHints import graphql.nadel.NadelExecutionInput.Companion.newNadelExecutionInput @@ -34,6 +32,7 @@ import kotlinx.coroutines.reactive.asPublisher import org.junit.jupiter.api.fail import org.reactivestreams.Publisher import java.io.File +import java.math.BigDecimal import java.math.BigInteger import java.util.concurrent.CompletableFuture @@ -163,7 +162,6 @@ private suspend fun execute( .overallWiringFactory(testHook.wiringFactory) .underlyingWiringFactory(testHook.wiringFactory) .serviceExecutionFactory(object : ServiceExecutionFactory { - private val astSorter = AstSorter() private val serviceCalls = fixture.serviceCalls.toMutableList() override fun getServiceExecution(serviceName: String): ServiceExecution { @@ -172,9 +170,11 @@ private suspend fun execute( val incomingQuery = params.query val actualVariables = fixVariables(params.variables) val actualOperationName = params.operationDefinition.name - val actualQuery = AstPrinter.printAst( - astSorter.sort(incomingQuery), + val actualRequest = canonicalizeServiceRequest( + document = incomingQuery, + variables = actualVariables, ) + val actualQuery = actualRequest.query printSyncLine(actualQuery) fun failWithFixtureContext(message: String): Nothing { @@ -192,10 +192,14 @@ private suspend fun execute( synchronized(serviceCalls) { val indexOfCall = serviceCalls .indexOfFirst { + val expectedRequest = canonicalizeServiceRequest( + document = it.request.document, + variables = it.request.variables, + ) + it.serviceName == serviceName - && AstPrinter.printAst(it.request.document) == actualQuery + && expectedRequest == actualRequest && it.request.operationName == actualOperationName - && it.request.variables == actualVariables } .takeIf { it != -1 } @@ -303,6 +307,9 @@ private suspend fun execute( } else { value.toLong() } + } else if (value is BigDecimal) { + // Jackson parses floating point fixture variables as Double + value.toDouble() } else if (value is AnyMap) { @Suppress("UNCHECKED_CAST") fixVariables(value as JsonMap) diff --git a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt new file mode 100644 index 000000000..80f0d0eab --- /dev/null +++ b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt @@ -0,0 +1,115 @@ +package graphql.nadel.tests + +import graphql.language.AstPrinter +import graphql.language.AstSorter +import graphql.language.AstTransformer +import graphql.language.Document +import graphql.language.Node +import graphql.language.NodeTraverser +import graphql.language.NodeVisitorStub +import graphql.language.OperationDefinition +import graphql.language.VariableDefinition +import graphql.language.VariableReference +import graphql.nadel.engine.util.JsonMap +import graphql.parser.Parser +import graphql.util.TraversalControl +import graphql.util.TraverserContext +import graphql.util.TreeTransformerUtil.changeNode + +internal data class CanonicalServiceRequest( + val query: String, + val variables: JsonMap, +) + +internal fun canonicalizeServiceRequest( + query: String, + variables: JsonMap, +): CanonicalServiceRequest { + return canonicalizeServiceRequest( + document = Parser().parseDocument(query), + variables = variables, + ) +} + +internal fun canonicalizeServiceRequest( + document: Document, + variables: JsonMap, +): CanonicalServiceRequest { + val sortedDocument = AstSorter().sort(document) + val variableNames = linkedSetOf() + + NodeTraverser().preOrder( + object : NodeVisitorStub() { + override fun visitVariableReference( + node: VariableReference, + context: TraverserContext>, + ): TraversalControl { + variableNames += node.name + return TraversalControl.CONTINUE + } + }, + sortedDocument, + ) + + val operation = sortedDocument.definitions + .filterIsInstance() + .single() + val definedVariableNames = operation.variableDefinitions + .mapTo(linkedSetOf()) { it.name } + + require(variableNames == definedVariableNames) { + "Service query variable definitions and references must match" + } + require(variables.keys.all(definedVariableNames::contains)) { + "Service variables must be declared by the service query" + } + + val canonicalNames = variableNames + .withIndex() + .associate { (index, name) -> + name to "v$index" + } + + val renamedDocument = AstTransformer().transform( + sortedDocument, + object : NodeVisitorStub() { + override fun visitVariableDefinition( + node: VariableDefinition, + context: TraverserContext>, + ): TraversalControl { + return changeNode( + context, + node.transform { builder -> + builder.name(canonicalNames.getValue(node.name)) + }, + ) + } + + override fun visitVariableReference( + node: VariableReference, + context: TraverserContext>, + ): TraversalControl { + return changeNode( + context, + node.transform { builder -> + builder.name(canonicalNames.getValue(node.name)) + }, + ) + } + }, + ) as Document + + val canonicalVariables = linkedMapOf() + canonicalNames.forEach { (name, canonicalName) -> + if (variables.containsKey(name)) { + canonicalVariables[canonicalName] = variables[name] + } + } + + return CanonicalServiceRequest( + query = AstPrinter.printAst( + AstSorter().sort(renamedDocument), + ), + variables = canonicalVariables, + ) +} diff --git a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt new file mode 100644 index 000000000..9824e2919 --- /dev/null +++ b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt @@ -0,0 +1,76 @@ +package graphql.nadel.tests + +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotEquals + +class ServiceRequestCanonicalizerTest { + @Test + fun `variable names and definition order do not affect a service request`() { + val expected = canonicalizeServiceRequest( + query = """ + query Test(${'$'}id: ID!, ${'$'}include: Boolean!) { + node(id: ${'$'}id) { + ...Fields @include(if: ${'$'}include) + } + } + + fragment Fields on Node { + id + } + """.trimIndent(), + variables = linkedMapOf( + "id" to "ari:example:1", + "include" to true, + ), + ) + val actual = canonicalizeServiceRequest( + query = """ + fragment Fields on Node { + id + } + + query Test(${'$'}condition: Boolean!, ${'$'}identifier: ID!) { + node(id: ${'$'}identifier) { + ...Fields @include(if: ${'$'}condition) + } + } + """.trimIndent(), + variables = linkedMapOf( + "condition" to true, + "identifier" to "ari:example:1", + ), + ) + + assertEquals(expected, actual) + assertEquals(listOf("v0", "v1"), actual.variables.keys.toList()) + } + + @Test + fun `variable bindings still affect a service request`() { + val expected = canonicalizeServiceRequest( + query = """ + query Test(${'$'}first: String!, ${'$'}second: String!) { + echo(first: ${'$'}first, second: ${'$'}second) + } + """.trimIndent(), + variables = mapOf( + "first" to "one", + "second" to "two", + ), + ) + val actual = canonicalizeServiceRequest( + query = """ + query Test(${'$'}a: String!, ${'$'}b: String!) { + echo(first: ${'$'}b, second: ${'$'}a) + } + """.trimIndent(), + variables = mapOf( + "a" to "one", + "b" to "two", + ), + ) + + assertNotEquals(expected, actual) + } +} diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/`introspection-with-variables-ff-on`.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/`introspection-with-variables-ff-on`.kt deleted file mode 100644 index 613621c33..000000000 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/`introspection-with-variables-ff-on`.kt +++ /dev/null @@ -1,13 +0,0 @@ -package graphql.nadel.tests.hooks - -import graphql.nadel.NadelExecutionHints -import graphql.nadel.tests.EngineTestHook -import graphql.nadel.tests.UseHook - -@UseHook -class `introspection-with-variables-ff-on` : EngineTestHook { - override fun makeExecutionHints(builder: NadelExecutionHints.Builder): NadelExecutionHints.Builder { - return super.makeExecutionHints(builder) - .allDocumentVariablesHint { true } - } -} diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/ari-argument-in-renamed-object-input-in-hydration.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/ari-argument-in-renamed-object-input-in-hydration.kt index b7aa231f6..ed7616d5d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/ari-argument-in-renamed-object-input-in-hydration.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/ari-argument-in-renamed-object-input-in-hydration.kt @@ -5,7 +5,6 @@ import graphql.language.ObjectField.newObjectField import graphql.language.ObjectValue import graphql.language.ObjectValue.newObjectValue import graphql.language.StringValue -import graphql.nadel.NadelExecutionHints import graphql.nadel.Service import graphql.nadel.ServiceExecutionHydrationDetails import graphql.nadel.ServiceExecutionResult @@ -186,8 +185,4 @@ class `ari-argument-in-renamed-object-input-in-hydration` : EngineTestHook { } ) - override fun makeExecutionHints(builder: NadelExecutionHints.Builder): NadelExecutionHints.Builder { - return builder - .allDocumentVariablesHint { true } - } } diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/chain-input-rename-with-argument-transform.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/chain-input-rename-with-argument-transform.kt index 408935a8f..8ecd430a3 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/chain-input-rename-with-argument-transform.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/chain-input-rename-with-argument-transform.kt @@ -2,7 +2,6 @@ package graphql.nadel.tests.hooks import graphql.language.NullValue import graphql.language.StringValue -import graphql.nadel.NadelExecutionHints import graphql.nadel.Service import graphql.nadel.ServiceExecutionHydrationDetails import graphql.nadel.ServiceExecutionResult @@ -102,8 +101,4 @@ class `ari-argument-in-renamed-input` : EngineTestHook { }, ) - override fun makeExecutionHints(builder: NadelExecutionHints.Builder): NadelExecutionHints.Builder { - return builder - .allDocumentVariablesHint { true } - } } diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/document-variables-handling.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/document-variables-handling.kt index c417232b6..0fa37b5e7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/document-variables-handling.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/document-variables-handling.kt @@ -1,7 +1,5 @@ package graphql.nadel.tests.hooks -import graphql.nadel.NadelExecutionHints -import graphql.nadel.NadelExecutionInput import graphql.nadel.schema.NeverWiringFactory import graphql.nadel.tests.EngineTestHook import graphql.nadel.tests.UseHook @@ -43,28 +41,18 @@ class `primitive-json-arguments-variables` : EngineTestHook { override val wiringFactory = NeverWiringFactoryWithExtendedJsonScalar() } -open class AllDocumentVariablesHintHook : EngineTestHook { +open class ExtendedJsonScalarWiringHook : EngineTestHook { override val wiringFactory = NeverWiringFactoryWithExtendedJsonScalar() - - override fun makeExecutionHints(builder: NadelExecutionHints.Builder): NadelExecutionHints.Builder { - return builder - .allDocumentVariablesHint { - true - } - } } @UseHook -class `inlined-all-arguments` : AllDocumentVariablesHintHook() - -@UseHook -class `inlined-all-arguments-with-mixed-literals-and-variables` : AllDocumentVariablesHintHook() +class `inlined-all-arguments` : ExtendedJsonScalarWiringHook() @UseHook -class `inlined-all-arguments-with-renamed-field` : AllDocumentVariablesHintHook() +class `inlined-all-arguments-with-mixed-literals-and-variables` : ExtendedJsonScalarWiringHook() @UseHook -class `inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list` : AllDocumentVariablesHintHook() +class `inlined-all-arguments-with-renamed-field` : ExtendedJsonScalarWiringHook() @UseHook -class `complex-identified-by-with-rename` : AllDocumentVariablesHintHook() +class `inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list` : ExtendedJsonScalarWiringHook() diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/transformer-on-hydration-fields.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/transformer-on-hydration-fields.kt index f5778505a..4a60b8393 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/transformer-on-hydration-fields.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/transformer-on-hydration-fields.kt @@ -70,7 +70,7 @@ class `transformer-on-hydration-fields` : EngineTestHook { state: Any, transformServiceExecutionContext: NadelTransformServiceExecutionContext?, ): NadelTransformFieldResult { - val transformedArgs = mapOf("id" to NormalizedInputValue("String", StringValue("transformed-id"))) + val transformedArgs = mapOf("id" to NormalizedInputValue("ID", StringValue("transformed-id"))) return transformer.transform(field.children) .let { field.toBuilder() diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/basic/call with variables inside input objects snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/basic/call with variables inside input objects snapshot.kt index dcfbe1c4a..36c8e90bc 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/basic/call with variables inside input objects snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/basic/call with variables inside input objects snapshot.kt @@ -24,11 +24,15 @@ public class `call with variables inside input objects snapshot` : TestSnapshot( ExpectedServiceCall( service = "MyService", query = """ - | query myQuery { - | hello(arg: {}) + | query myQuery(${'$'}v0: Arg) { + | hello(arg: ${'$'}v0) + | } + """.trimMargin(), + variables = """ + | { + | "v0": {} | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform on renamed field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform on renamed field snapshot.kt index 65874ec0a..c0e9c9828 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform on renamed field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform on renamed field snapshot.kt @@ -24,14 +24,18 @@ public class `ari argument transform on renamed field snapshot` : TestSnapshot() ExpectedServiceCall( service = "service", query = """ - | { - | rename__issue__issueById: issueById(id: "57") { + | query (${'$'}v0: ID) { + | rename__issue__issueById: issueById(id: ${'$'}v0) { | __typename__rename__key: __typename | rename__key__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "57" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform snapshot.kt index 083df7640..30b631f6e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/chained transforms/ari use case/ari argument transform snapshot.kt @@ -24,14 +24,18 @@ public class `ari argument transform snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | issue(id: "57") { + | query (${'$'}v0: ID) { + | issue(id: ${'$'}v0) { | __typename__rename__key: __typename | rename__key__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "57" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration null object snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration null object snapshot.kt index 45be83930..95593f7fb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration null object snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration null object snapshot.kt @@ -24,8 +24,8 @@ public class `deep rename inside batch hydration null object snapshot` : TestSna ExpectedServiceCall( service = "IssueService", query = """ - | { - | issuesByIds(id: ["issue-1", "issue-2", "issue-3"]) { + | query (${'$'}v0: [ID!]) { + | issuesByIds(id: ${'$'}v0) { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { | detailName @@ -34,7 +34,15 @@ public class `deep rename inside batch hydration null object snapshot` : TestSna | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue-1", + | "issue-2", + | "issue-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration snapshot.kt index 9866eba63..e66fcf56a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside batch hydration snapshot.kt @@ -24,8 +24,8 @@ public class `deep rename inside batch hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issuesByIds(id: ["issue-1", "issue-2", "issue-3"]) { + | query (${'$'}v0: [ID!]) { + | issuesByIds(id: ${'$'}v0) { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { | detailName @@ -34,7 +34,15 @@ public class `deep rename inside batch hydration snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue-1", + | "issue-2", + | "issue-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydration snapshot.kt index 7c059c727..362f8fb17 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydration snapshot.kt @@ -24,8 +24,8 @@ public class `deep rename inside hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { | detailName @@ -33,7 +33,11 @@ public class `deep rename inside hydration snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydrations snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydrations snapshot.kt index a2151bc80..bf81c6427 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydrations snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename inside hydrations snapshot.kt @@ -24,8 +24,8 @@ public class `deep rename inside hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { | detailName @@ -33,7 +33,11 @@ public class `deep rename inside hydrations snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -52,8 +56,8 @@ public class `deep rename inside hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-2") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { | detailName @@ -61,7 +65,11 @@ public class `deep rename inside hydrations snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-2" + | } + """.trimMargin(), result = """ | { | "data": { @@ -80,8 +88,8 @@ public class `deep rename inside hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-3") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { | detailName @@ -89,7 +97,11 @@ public class `deep rename inside hydrations snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-3" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename with argument works snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename with argument works snapshot.kt index 93926033d..325057ca8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename with argument works snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/deep renames/deep rename with argument works snapshot.kt @@ -24,16 +24,20 @@ public class `deep rename with argument works snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { + | query (${'$'}v0: ID!) { | issue { | __typename__deep_rename__name: __typename | deep_rename__name__detail: detail { - | detailName(userId: "USER-01") + | detailName(userId: ${'$'}v0) | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "USER-01" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/inlined json arguments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/inlined json arguments snapshot.kt index 7b169e863..e14a56956 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/inlined json arguments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/inlined json arguments snapshot.kt @@ -24,15 +24,17 @@ public class `inlined json arguments snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | query myQuery(${'$'}v0: JSON, ${'$'}v1: JSON!) { - | hello(arg: {payload : ${'$'}v0}, arg1: ${'$'}v1) + | query myQuery(${'$'}v0: InputWithJson, ${'$'}v1: JSON!) { + | hello(arg: ${'$'}v0, arg1: ${'$'}v1) | } """.trimMargin(), variables = """ | { | "v0": { - | "name": "Bobert", - | "age": "23" + | "payload": { + | "name": "Bobert", + | "age": "23" + | } | }, | "v1": { | "interests": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/input object with json field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/input object with json field snapshot.kt index 302096e83..38c09528e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/input object with json field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/input object with json field snapshot.kt @@ -24,14 +24,16 @@ public class `input object with json field snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | query myQuery(${'$'}v0: JSON) { - | hello(arg: {payload : ${'$'}v0}) + | query myQuery(${'$'}v0: InputWithJson) { + | hello(arg: ${'$'}v0) | } """.trimMargin(), variables = """ | { | "v0": { - | "48x48": "file.jpeg" + | "payload": { + | "48x48": "file.jpeg" + | } | } | } """.trimMargin(), diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments snapshot.kt index 3dde3b585..da5d5153d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments snapshot.kt @@ -24,13 +24,15 @@ public class `primitive json arguments snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | query myQuery(${'$'}v0: JSON, ${'$'}v1: JSON!) { - | hello(arg: {payload : ${'$'}v0}, arg1: ${'$'}v1) + | query myQuery(${'$'}v0: InputWithJson, ${'$'}v1: JSON!) { + | hello(arg: ${'$'}v0, arg1: ${'$'}v1) | } """.trimMargin(), variables = """ | { - | "v0": "String JSON input", + | "v0": { + | "payload": "String JSON input" + | }, | "v1": false | } """.trimMargin(), diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments variables snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments variables snapshot.kt index c69663851..07d4e5127 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments variables snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/document variable handling/primitive json arguments variables snapshot.kt @@ -24,13 +24,15 @@ public class `primitive json arguments variables snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | query myQuery(${'$'}v0: JSON, ${'$'}v1: JSON!) { - | hello(arg: {payload : ${'$'}v0}, arg1: ${'$'}v1) + | query myQuery(${'$'}v0: InputWithJson, ${'$'}v1: JSON!) { + | hello(arg: ${'$'}v0, arg1: ${'$'}v1) | } """.trimMargin(), variables = """ | { - | "v0": "String JSON input", + | "v0": { + | "payload": "String JSON input" + | }, | "v1": false | } """.trimMargin(), diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles complex fragments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles complex fragments snapshot.kt index 757432f21..48d992d81 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles complex fragments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles complex fragments snapshot.kt @@ -24,8 +24,8 @@ public class `dynamic service resolution handles complex fragments snapshot` : T ExpectedServiceCall( service = "RepoService", query = """ - | { - | node(id: "pull-request:id-123") { + | query (${'$'}v0: ID!) { + | node(id: ${'$'}v0) { | id | ... on PullRequest { | author { @@ -37,7 +37,11 @@ public class `dynamic service resolution handles complex fragments snapshot` : T | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "pull-request:id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles inline fragments from multiple services snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles inline fragments from multiple services snapshot.kt index eef67c90f..3d0158388 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles inline fragments from multiple services snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution handles inline fragments from multiple services snapshot.kt @@ -25,8 +25,8 @@ public class `dynamic service resolution handles inline fragments from multiple ExpectedServiceCall( service = "RepoService", query = """ - | { - | node(id: "pull-request:id-123") { + | query (${'$'}v0: ID!) { + | node(id: ${'$'}v0) { | __typename__type_filter__issueKey: __typename | id | ... on PullRequest { @@ -35,7 +35,11 @@ public class `dynamic service resolution handles inline fragments from multiple | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "pull-request:id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services snapshot.kt index 1a7b6cb7e..b4fa62d11 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services snapshot.kt @@ -24,8 +24,8 @@ public class `dynamic service resolution multiple services snapshot` : TestSnaps ExpectedServiceCall( service = "IssueService", query = """ - | { - | issue: node(id: "issue/id-123") { + | query (${'$'}v0: ID!) { + | issue: node(id: ${'$'}v0) { | id | ... on Issue { | issueKey @@ -33,7 +33,11 @@ public class `dynamic service resolution multiple services snapshot` : TestSnaps | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue/id-123" + | } + """.trimMargin(), result = """ | { | "data": { @@ -50,8 +54,8 @@ public class `dynamic service resolution multiple services snapshot` : TestSnaps ExpectedServiceCall( service = "RepoService", query = """ - | { - | pr: node(id: "pull-request:id-123") { + | query (${'$'}v0: ID!) { + | pr: node(id: ${'$'}v0) { | id | ... on PullRequest { | description @@ -59,7 +63,11 @@ public class `dynamic service resolution multiple services snapshot` : TestSnaps | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "pull-request:id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services with one unmapped node lookup snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services with one unmapped node lookup snapshot.kt index b8ed5463d..d5b116b4d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services with one unmapped node lookup snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution multiple services with one unmapped node lookup snapshot.kt @@ -25,8 +25,8 @@ public class `dynamic service resolution multiple services with one unmapped nod ExpectedServiceCall( service = "IssueService", query = """ - | { - | issue: node(id: "issue/id-123") { + | query (${'$'}v0: ID!) { + | issue: node(id: ${'$'}v0) { | id | ... on Issue { | issueKey @@ -34,7 +34,11 @@ public class `dynamic service resolution multiple services with one unmapped nod | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue/id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution simple success case snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution simple success case snapshot.kt index 3bd7d774c..384ef2e7b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution simple success case snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution simple success case snapshot.kt @@ -24,8 +24,8 @@ public class `dynamic service resolution simple success case snapshot` : TestSna ExpectedServiceCall( service = "RepoService", query = """ - | { - | node(id: "pull-request:id-123") { + | query (${'$'}v0: ID!) { + | node(id: ${'$'}v0) { | id | ... on PullRequest { | description @@ -33,7 +33,11 @@ public class `dynamic service resolution simple success case snapshot` : TestSna | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "pull-request:id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution with no fragments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution with no fragments snapshot.kt index 7ca821a42..1f31e9e88 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution with no fragments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/dynamic service resolution with no fragments snapshot.kt @@ -24,13 +24,17 @@ public class `dynamic service resolution with no fragments snapshot` : TestSnaps ExpectedServiceCall( service = "RepoService", query = """ - | { - | node(id: "pull-request:id-123") { + | query (${'$'}v0: ID!) { + | node(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "pull-request:id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/typename is passed on queries using dynamic resolved services snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/typename is passed on queries using dynamic resolved services snapshot.kt index 6956b075a..5a6a2134e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/typename is passed on queries using dynamic resolved services snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/dynamic service resolution/typename is passed on queries using dynamic resolved services snapshot.kt @@ -25,8 +25,8 @@ public class `typename is passed on queries using dynamic resolved services snap ExpectedServiceCall( service = "RepoService", query = """ - | { - | node(id: "pull-request:id-123") { + | query (${'$'}v0: ID!) { + | node(id: ${'$'}v0) { | __typename | id | ... on PullRequest { @@ -35,7 +35,11 @@ public class `typename is passed on queries using dynamic resolved services snap | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "pull-request:id-123" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible snapshot.kt index 932d3234c..5b7e85c2d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible snapshot.kt @@ -70,14 +70,18 @@ public class `extending types from another service is possible snapshot` : TestS ExpectedServiceCall( service = "Service2", query = """ - | { - | lookup(id: "rootId") { + | query (${'$'}v0: ID) { + | lookup(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "rootId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible with synthetic fields snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible with synthetic fields snapshot.kt index ba77b4fbe..a4d83047b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible with synthetic fields snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types from another service is possible with synthetic fields snapshot.kt @@ -71,16 +71,20 @@ public class `extending types from another service is possible with synthetic fi ExpectedServiceCall( service = "Service2", query = """ - | { + | query (${'$'}v0: ID) { | lookUpQuery { - | lookup(id: "rootId") { + | lookup(id: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "rootId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration returning a connection snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration returning a connection snapshot.kt index 8cb15d185..649c7c09a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration returning a connection snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration returning a connection snapshot.kt @@ -24,8 +24,8 @@ public class `extending types via hydration returning a connection snapshot` : T ExpectedServiceCall( service = "Association", query = """ - | { - | association(filter: {name : "value"}, id: "ISSUE-1") { + | query (${'$'}v0: ID, ${'$'}v1: Filter) { + | association(filter: ${'$'}v1, id: ${'$'}v0) { | nodes { | __typename__hydration__page: __typename | hydration__page__pageId: pageId @@ -33,7 +33,14 @@ public class `extending types via hydration returning a connection snapshot` : T | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1", + | "v1": { + | "name": "value" + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,15 +61,19 @@ public class `extending types via hydration returning a connection snapshot` : T ExpectedServiceCall( service = "Association", query = """ - | { + | query (${'$'}v0: ID) { | pages { - | page(id: "1") { + | page(id: ${'$'}v0) { | id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with arguments passed on snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with arguments passed on snapshot.kt index 485cab7fd..f31b37c9c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with arguments passed on snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with arguments passed on snapshot.kt @@ -24,13 +24,20 @@ public class `extending types via hydration with arguments passed on snapshot` : ExpectedServiceCall( service = "Association", query = """ - | { - | association(filter: {name : "value"}, id: "ISSUE-1") { + | query (${'$'}v0: ID, ${'$'}v1: Filter) { + | association(filter: ${'$'}v1, id: ${'$'}v0) { | nameOfAssociation | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1", + | "v1": { + | "name": "value" + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with variables arguments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with variables arguments snapshot.kt index e101d8728..443696d07 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with variables arguments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/extend type/extending types via hydration with variables arguments snapshot.kt @@ -24,13 +24,20 @@ public class `extending types via hydration with variables arguments snapshot` : ExpectedServiceCall( service = "Association", query = """ - | query MyQuery { - | association(filter: {name : "value"}, id: "ISSUE-1") { + | query MyQuery(${'$'}v0: ID, ${'$'}v1: Filter) { + | association(filter: ${'$'}v1, id: ${'$'}v0) { | nameOfAssociation | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1", + | "v1": { + | "name": "value" + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hidden namespaced hydration top level field is removed snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hidden namespaced hydration top level field is removed snapshot.kt index 0fe8ed305..2e06b7505 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hidden namespaced hydration top level field is removed snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hidden namespaced hydration top level field is removed snapshot.kt @@ -24,15 +24,19 @@ public class `hidden namespaced hydration top level field is removed snapshot` : ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "C1") { + | query (${'$'}v0: ID) { + | issueById(id: ${'$'}v0) { | __typename__hydration__comment: __typename | hydration__comment__commentId: commentId | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "C1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hydration top level field is removed snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hydration top level field is removed snapshot.kt index 19bcaf5ad..cb0fe307c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hydration top level field is removed snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/hydration top level field is removed snapshot.kt @@ -24,15 +24,19 @@ public class `hydration top level field is removed snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "C1") { + | query (${'$'}v0: ID) { + | issueById(id: ${'$'}v0) { | __typename__hydration__comment: __typename | hydration__comment__commentId: commentId | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "C1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/namespaced hydration top level field is removed snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/namespaced hydration top level field is removed snapshot.kt index a35dc98ac..e4d3f2a4a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/namespaced hydration top level field is removed snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/namespaced hydration top level field is removed snapshot.kt @@ -24,15 +24,19 @@ public class `namespaced hydration top level field is removed snapshot` : TestSn ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "C1") { + | query (${'$'}v0: ID) { + | issueById(id: ${'$'}v0) { | __typename__hydration__comment: __typename | hydration__comment__commentId: commentId | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "C1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/renamed top level field is not removed short circuit hint is on snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/renamed top level field is not removed short circuit hint is on snapshot.kt index 3ba8771ec..19c2b42f9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/renamed top level field is not removed short circuit hint is on snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/field removed/renamed top level field is not removed short circuit hint is on snapshot.kt @@ -25,13 +25,17 @@ public class `renamed top level field is not removed short circuit hint is on sn ExpectedServiceCall( service = "CommentService", query = """ - | { - | rename__commentById__commentByIdUnderlying: commentByIdUnderlying(id: "C1") { + | query (${'$'}v0: ID) { + | rename__commentById__commentByIdUnderlying: commentByIdUnderlying(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "C1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt index e36f7def4..e1ebb32fa 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt @@ -24,13 +24,17 @@ public class `graphqlcontextispresentoninput snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | { - | hello(arg: "x") { + | query (${'$'}v0: String) { + | hello(arg: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "x" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables FF on snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables snapshot.kt similarity index 95% rename from test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables FF on snapshot.kt rename to test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables snapshot.kt index c36bf6c81..b35bdfebf 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables FF on snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables snapshot.kt @@ -10,7 +10,7 @@ import kotlin.collections.List import kotlin.collections.listOf private suspend fun main() { - graphql.nadel.tests.next.update<`introspection with variables FF on`>() + graphql.nadel.tests.next.update<`introspection with variables`>() } /** @@ -19,7 +19,7 @@ private suspend fun main() { * Refer to [graphql.nadel.tests.next.UpdateTestSnapshots */ @Suppress("unused") -public class `introspection with variables FF on snapshot` : TestSnapshot() { +public class `introspection with variables snapshot` : TestSnapshot() { override val calls: List = listOf( ) diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables FF on.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables.kt similarity index 95% rename from test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables FF on.kt rename to test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables.kt index ab9e92dee..9ba484d09 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables FF on.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/introspection/introspection with variables.kt @@ -2,7 +2,7 @@ package graphql.nadel.tests.legacy.introspection import graphql.nadel.tests.legacy.NadelLegacyIntegrationTest -class `introspection with variables FF on` : NadelLegacyIntegrationTest( +class `introspection with variables` : NadelLegacyIntegrationTest( query = """ query { __schema { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/java-compat/java ari transform snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/java-compat/java ari transform snapshot.kt index 6a99250e3..f6997ff1b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/java-compat/java ari transform snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/java-compat/java ari transform snapshot.kt @@ -24,14 +24,18 @@ public class `java ari transform snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | issue(id: "57") { + | query (${'$'}v0: ID) { + | issue(id: ${'$'}v0) { | __typename__rename__key: __typename | rename__key__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "57" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/able to ask for field and use same field as hydration source snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/able to ask for field and use same field as hydration source snapshot.kt index f35380404..43579a14d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/able to ask for field and use same field as hydration source snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/able to ask for field and use same field as hydration source snapshot.kt @@ -53,15 +53,19 @@ public class `able to ask for field and use same field as hydration source snaps ExpectedServiceCall( service = "Bar", query = """ - | { - | barById(id: "1") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | __typename__hydration__nestedBar: __typename | hydration__nestedBar__barId: barId | barId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -79,13 +83,17 @@ public class `able to ask for field and use same field as hydration source snaps ExpectedServiceCall( service = "Bar", query = """ - | { - | barById(id: "1") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | barId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a batch hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a batch hydration snapshot.kt index 1ff1f48d7..27999331d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a batch hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a batch hydration snapshot.kt @@ -72,14 +72,21 @@ public class `some object fields in the result are backed a batch hydration snap ExpectedServiceCall( service = "users", query = """ - | { - | usersByIds(ids: ["user-100", "user-20"]) { + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__user__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "user-100", + | "user-20" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a hydration snapshot.kt index 89d54e62a..60741fe97 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some object fields in the result are backed a hydration snapshot.kt @@ -71,13 +71,17 @@ public class `some object fields in the result are backed a hydration snapshot` ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "user-100") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "user-100" + | } + """.trimMargin(), result = """ | { | "data": { @@ -93,13 +97,17 @@ public class `some object fields in the result are backed a hydration snapshot` ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "user-20") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "user-20" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a batch hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a batch hydration snapshot.kt index 493e66464..a9acb0bb9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a batch hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a batch hydration snapshot.kt @@ -73,14 +73,21 @@ public class ExpectedServiceCall( service = "users", query = """ - | { - | usersByIds(ids: ["user-100", "user-20"]) { + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__user__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "user-100", + | "user-20" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a hydration snapshot.kt index 32758eaa8..c67284a56 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/abstract types/some renamed object types have fields in the result are backed a hydration snapshot.kt @@ -72,13 +72,17 @@ public class `some renamed object types have fields in the result are backed a h ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "user-100") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "user-100" + | } + """.trimMargin(), result = """ | { | "data": { @@ -94,13 +98,17 @@ public class `some renamed object types have fields in the result are backed a h ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "user-20") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "user-20" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/all hydration fields are seen by transformer snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/all hydration fields are seen by transformer snapshot.kt index 71b7946ab..6d27732dd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/all hydration fields are seen by transformer snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/all hydration fields are seen by transformer snapshot.kt @@ -48,15 +48,19 @@ public class `all hydration fields are seen by transformer snapshot` : TestSnaps ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: ID) { | bars { - | barById(id: "barId") { + | barById(id: ${'$'}v0) { | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true equals condition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true equals condition snapshot.kt index 91d1e5e32..9658d913c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true equals condition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true equals condition snapshot.kt @@ -50,13 +50,17 @@ public class `basic conditional hydration with true equals condition snapshot` : ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true matches condition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true matches condition snapshot.kt index d109f464c..99b3ecfb3 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true matches condition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true matches condition snapshot.kt @@ -50,13 +50,17 @@ public class `basic conditional hydration with true matches condition snapshot` ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true startsWith condition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true startsWith condition snapshot.kt index e4e3253a9..73ce18a17 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true startsWith condition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic conditional hydration with true startsWith condition snapshot.kt @@ -51,13 +51,17 @@ public class `basic conditional hydration with true startsWith condition snapsho ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration directive based snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration directive based snapshot.kt index 33db8a5e8..1b265fa58 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration directive based snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration directive based snapshot.kt @@ -48,13 +48,17 @@ public class `basic hydration directive based snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration snapshot.kt index 3007e776c..db05a1113 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration snapshot.kt @@ -48,13 +48,17 @@ public class `basic hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with actor field rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with actor field rename snapshot.kt index 36f4d27ae..538c2af6b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with actor field rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with actor field rename snapshot.kt @@ -48,13 +48,17 @@ public class `basic hydration with actor field rename snapshot` : TestSnapshot() ExpectedServiceCall( service = "service2", query = """ - | { - | rename__barByIdOverall__barById: barById(id: "barId") { + | query (${'$'}v0: ID) { + | rename__barByIdOverall__barById: barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default array argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default array argument values snapshot.kt index 716f0b6ef..1cb31070c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default array argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default array argument values snapshot.kt @@ -48,13 +48,21 @@ public class `basic hydration with default array argument values snapshot` : Tes ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId", test: ["Hello", "World"]) { + | query (${'$'}v0: ID, ${'$'}v1: [String]) { + | barById(id: ${'$'}v0, test: ${'$'}v1) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": [ + | "Hello", + | "World" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default boolean argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default boolean argument values snapshot.kt index 5112eda70..169024096 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default boolean argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default boolean argument values snapshot.kt @@ -48,13 +48,18 @@ public class `basic hydration with default boolean argument values snapshot` : T ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId", test: false) { + | query (${'$'}v0: ID, ${'$'}v1: Boolean) { + | barById(id: ${'$'}v0, test: ${'$'}v1) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": false + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default int argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default int argument values snapshot.kt index 39f6a34f7..fa68b03b7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default int argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default int argument values snapshot.kt @@ -48,13 +48,18 @@ public class `basic hydration with default int argument values snapshot` : TestS ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId", test: 10) { + | query (${'$'}v0: ID, ${'$'}v1: Int) { + | barById(id: ${'$'}v0, test: ${'$'}v1) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": 10 + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default null argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default null argument values snapshot.kt index 045a8b011..8b8f1561d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default null argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default null argument values snapshot.kt @@ -48,13 +48,18 @@ public class `basic hydration with default null argument values snapshot` : Test ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId", test: null) { + | query (${'$'}v0: ID, ${'$'}v1: Boolean) { + | barById(id: ${'$'}v0, test: ${'$'}v1) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": null + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default object argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default object argument values snapshot.kt index 6a111f2c7..23bfedf5e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default object argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default object argument values snapshot.kt @@ -48,13 +48,20 @@ public class `basic hydration with default object argument values snapshot` : Te ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId", test: {echo : "Hello World"}) { + | query (${'$'}v0: ID, ${'$'}v1: Test) { + | barById(id: ${'$'}v0, test: ${'$'}v1) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": { + | "echo": "Hello World" + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default string argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default string argument values snapshot.kt index a92db806d..44b9a90b3 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default string argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with default string argument values snapshot.kt @@ -48,13 +48,18 @@ public class `basic hydration with default string argument values snapshot` : Te ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId", test: "Hello World") { + | query (${'$'}v0: ID, ${'$'}v1: String) { + | barById(id: ${'$'}v0, test: ${'$'}v1) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": "Hello World" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg array snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg array snapshot.kt index 5d9c49243..b22d41bf3 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg array snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg array snapshot.kt @@ -48,13 +48,22 @@ public class `basic hydration with static arg array snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(friendIds: ["barId2", "barId3", "barId4"], id: "barId") { + | query (${'$'}v0: ID, ${'$'}v1: [ID]) { + | barById(friendIds: ${'$'}v1, id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": [ + | "barId2", + | "barId3", + | "barId4" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg boolean snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg boolean snapshot.kt index d04e676f9..879cb1bd8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg boolean snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg boolean snapshot.kt @@ -46,13 +46,17 @@ public class `basic hydration with static arg boolean snapshot` : TestSnapshot() ExpectedServiceCall( service = "service2", query = """ - | { - | barWithSomeAttribute(someAttribute: true) { + | query (${'$'}v0: Boolean) { + | barWithSomeAttribute(someAttribute: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg float snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg float snapshot.kt index 829b0f49a..8510ae7ef 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg float snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg float snapshot.kt @@ -46,13 +46,17 @@ public class `basic hydration with static arg float snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barWithSomeFloat(someFloat: 123.45) { + | query (${'$'}v0: Float) { + | barWithSomeFloat(someFloat: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 123.45 + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg integer snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg integer snapshot.kt index a80ebb32d..13ba8d112 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg integer snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg integer snapshot.kt @@ -46,13 +46,17 @@ public class `basic hydration with static arg integer snapshot` : TestSnapshot() ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: 12345) { + | query (${'$'}v0: Int) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 12345 + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object array snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object array snapshot.kt index d5e106e1c..0129f05e8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object array snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object array snapshot.kt @@ -48,13 +48,31 @@ public class `basic hydration with static arg object array snapshot` : TestSnaps ExpectedServiceCall( service = "service2", query = """ - | { - | barById(friends: [{firstName : "first", lastName : "last"}, {firstName : "first2", lastName : "last2"}, {firstName : "first3", lastName : "last3"}], id: "barId") { + | query (${'$'}v0: ID, ${'$'}v1: [FullName]) { + | barById(friends: ${'$'}v1, id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": [ + | { + | "firstName": "first", + | "lastName": "last" + | }, + | { + | "firstName": "first2", + | "lastName": "last2" + | }, + | { + | "firstName": "first3", + | "lastName": "last3" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object snapshot.kt index 50cd170b4..f2b48a940 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static arg object snapshot.kt @@ -48,13 +48,21 @@ public class `basic hydration with static arg object snapshot` : TestSnapshot() ExpectedServiceCall( service = "service2", query = """ - | { - | barById(fullName: {firstName : "first", lastName : "last"}, id: "barId") { + | query (${'$'}v0: ID, ${'$'}v1: FullName) { + | barById(fullName: ${'$'}v1, id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId", + | "v1": { + | "firstName": "first", + | "lastName": "last" + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static args snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static args snapshot.kt index 19922fe35..e73e993b7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static args snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/basic hydration with static args snapshot.kt @@ -46,13 +46,17 @@ public class `basic hydration with static args snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration instruction hook returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration instruction hook returns null snapshot.kt index 5f0b1a3a5..5e548a7d1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration instruction hook returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration instruction hook returns null snapshot.kt @@ -24,15 +24,19 @@ public class `batch hydration instruction hook returns null snapshot` : TestSnap ExpectedServiceCall( service = "Issues", query = """ - | { - | issueById(id: "10000") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__batch_hydration__collaborators: __typename | batch_hydration__collaborators__collaboratorIds: collaboratorIds | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "10000" + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,15 +58,22 @@ public class `batch hydration instruction hook returns null snapshot` : TestSnap ExpectedServiceCall( service = "Users", query = """ - | { - | usersByIds(ids: ["100", "200"]) { + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | __typename | batch_hydration__collaborators__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "100", + | "200" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration null source object snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration null source object snapshot.kt index c78425e88..8cfe0e9d6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration null source object snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration null source object snapshot.kt @@ -53,14 +53,20 @@ public class `batch hydration null source object snapshot` : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | usersByIds(ids: ["user-256"]) { + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__assignee__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "user-256" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration with renamed actor field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration with renamed actor field snapshot.kt index 5a29f75c0..394b209ab 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration with renamed actor field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batch hydration with renamed actor field snapshot.kt @@ -52,14 +52,22 @@ public class `batch hydration with renamed actor field snapshot` : TestSnapshot( ExpectedServiceCall( service = "service2", query = """ - | { - | rename__barsByIdOverall__barsById: barsById(id: ["barId1", "barId2", "barId3"]) { + | query (${'$'}v0: [ID]) { + | rename__barsByIdOverall__barsById: barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration query with a synthetic field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration query with a synthetic field snapshot.kt index 2e910fa28..b3e4e58d8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration query with a synthetic field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration query with a synthetic field snapshot.kt @@ -71,16 +71,24 @@ public class `batched hydration query with a synthetic field snapshot` : TestSna ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | users { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,16 +117,23 @@ public class `batched hydration query with a synthetic field snapshot` : TestSna ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | users { - | usersByIds(id: ["USER-4", "USER-5"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default array argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default array argument values snapshot.kt index 169583fe8..5f671825e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default array argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default array argument values snapshot.kt @@ -71,14 +71,26 @@ public class `batched hydration with default array argument values snapshot` : T ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: ["Hello", "World"]) { + | query (${'$'}v0: [String], ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Hello", + | "World" + | ], + | "v1": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +117,25 @@ public class `batched hydration with default array argument values snapshot` : T ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"], test: ["Hello", "World"]) { + | query (${'$'}v0: [String], ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Hello", + | "World" + | ], + | "v1": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default boolean argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default boolean argument values snapshot.kt index bd93da8e0..b3dcfe08d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default boolean argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default boolean argument values snapshot.kt @@ -71,14 +71,23 @@ public class `batched hydration with default boolean argument values snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: true) { + | query (${'$'}v0: Boolean, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true, + | "v1": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +114,22 @@ public class `batched hydration with default boolean argument values snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"], test: true) { + | query (${'$'}v0: Boolean, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true, + | "v1": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default int argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default int argument values snapshot.kt index bdf4346ed..4ea66ee98 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default int argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default int argument values snapshot.kt @@ -71,14 +71,23 @@ public class `batched hydration with default int argument values snapshot` : Tes ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: 42) { + | query (${'$'}v0: Int, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 42, + | "v1": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +114,22 @@ public class `batched hydration with default int argument values snapshot` : Tes ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"], test: 42) { + | query (${'$'}v0: Int, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 42, + | "v1": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default null argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default null argument values snapshot.kt index a3595ce57..15853fb36 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default null argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default null argument values snapshot.kt @@ -71,14 +71,23 @@ public class `batched hydration with default null argument values snapshot` : Te ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: null) { + | query (${'$'}v0: String, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": null, + | "v1": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +114,22 @@ public class `batched hydration with default null argument values snapshot` : Te ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"], test: null) { + | query (${'$'}v0: String, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": null, + | "v1": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default object argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default object argument values snapshot.kt index f12773372..71f0804c4 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default object argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default object argument values snapshot.kt @@ -71,14 +71,25 @@ public class `batched hydration with default object argument values snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: {echo : "Hello World"}) { + | query (${'$'}v0: Test, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": { + | "echo": "Hello World" + | }, + | "v1": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +116,24 @@ public class `batched hydration with default object argument values snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"], test: {echo : "Hello World"}) { + | query (${'$'}v0: Test, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": { + | "echo": "Hello World" + | }, + | "v1": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default string argument values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default string argument values snapshot.kt index 87f0bbfcd..0c69e697d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default string argument values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batched hydration with default string argument values snapshot.kt @@ -71,14 +71,23 @@ public class `batched hydration with default string argument values snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: "Hello World") { + | query (${'$'}v0: String, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "Hello World", + | "v1": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +114,22 @@ public class `batched hydration with default string argument values snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"], test: "Hello World") { + | query (${'$'}v0: String, ${'$'}v1: [ID]) { + | usersByIds(id: ${'$'}v1, test: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "Hello World", + | "v1": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list snapshot.kt index 5c3b7633d..2f808ce5a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list snapshot.kt @@ -71,14 +71,22 @@ public class `batching of hydration list snapshot` : TestSnapshot() { ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,14 +113,21 @@ public class `batching of hydration list snapshot` : TestSnapshot() { ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with flattened arguments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with flattened arguments snapshot.kt index ff6ad1fdf..30d9f24ba 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with flattened arguments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with flattened arguments snapshot.kt @@ -85,14 +85,22 @@ public class `batching of hydration list with flattened arguments snapshot` : Te ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -119,14 +127,21 @@ public class `batching of hydration list with flattened arguments snapshot` : Te ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-4", "USER-5"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with partition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with partition snapshot.kt index 1b7df6e10..6a781f3af 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with partition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching of hydration list with partition snapshot.kt @@ -70,14 +70,21 @@ public class `batching of hydration list with partition snapshot` : TestSnapshot ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["CLOUD-ID-1/USER-1", "CLOUD-ID-1/USER-3"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "CLOUD-ID-1/USER-1", + | "CLOUD-ID-1/USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -100,14 +107,20 @@ public class `batching of hydration list with partition snapshot` : TestSnapshot ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["CLOUD-ID-1/USER-5"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "CLOUD-ID-1/USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -126,14 +139,21 @@ public class `batching of hydration list with partition snapshot` : TestSnapshot ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["CLOUD-ID-2/USER-2", "CLOUD-ID-2/USER-4"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "CLOUD-ID-2/USER-2", + | "CLOUD-ID-2/USER-4" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching absent source input snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching absent source input snapshot.kt index c32f6c22b..82065f8ec 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching absent source input snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching absent source input snapshot.kt @@ -24,8 +24,8 @@ public class `batching absent source input snapshot` : TestSnapshot() { ExpectedServiceCall( service = "comments", query = """ - | { - | commentsByIds(ids: ["comment/9001"]) { + | query (${'$'}v0: [ID!]!) { + | commentsByIds(ids: ${'$'}v0) { | __typename | content | id @@ -33,7 +33,13 @@ public class `batching absent source input snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "comment/9001" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,8 +60,8 @@ public class `batching absent source input snapshot` : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issuesByIds(ids: ["issue/1234"]) { + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename | id | batch_hydration__content__id: id @@ -63,7 +69,13 @@ public class `batching absent source input snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue/1234" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration accepts true condition after a false condition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration accepts true condition after a false condition snapshot.kt index 793b01e94..3e62196d8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration accepts true condition after a false condition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration accepts true condition after a false condition snapshot.kt @@ -57,14 +57,21 @@ public class ExpectedServiceCall( service = "service2", query = """ - | { - | othersById(ids: ["barId1", "barId2"]) { + | query (${'$'}v0: [ID]) { + | othersById(ids: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration in abstract type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration in abstract type snapshot.kt index 645c2c53f..0270f527d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration in abstract type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration in abstract type snapshot.kt @@ -76,8 +76,8 @@ public class `batching conditional hydration in abstract type snapshot` : TestSn ExpectedServiceCall( service = "monolith", query = """ - | { - | commentsByIds(ids: ["comment/5000", "comment/6000", "comment/1234", "comment/9001"]) { + | query (${'$'}v0: [ID!]!) { + | commentsByIds(ids: ${'$'}v0) { | __typename | content | id @@ -85,7 +85,16 @@ public class `batching conditional hydration in abstract type snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "comment/5000", + | "comment/6000", + | "comment/1234", + | "comment/9001" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -124,8 +133,8 @@ public class `batching conditional hydration in abstract type snapshot` : TestSn ExpectedServiceCall( service = "monolith", query = """ - | { - | issuesByIds(ids: ["issue/4000"]) { + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename | id | batch_hydration__content__id: id @@ -133,7 +142,13 @@ public class `batching conditional hydration in abstract type snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue/4000" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -154,8 +169,8 @@ public class `batching conditional hydration in abstract type snapshot` : TestSn ExpectedServiceCall( service = "monolith", query = """ - | { - | issuesByIds(ids: ["issue/8080", "issue/7496"]) { + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename | id | batch_hydration__content__id: id @@ -163,7 +178,14 @@ public class `batching conditional hydration in abstract type snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue/8080", + | "issue/7496" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with list condition field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with list condition field snapshot.kt index ce9d7b5ff..797db771d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with list condition field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with list condition field snapshot.kt @@ -52,14 +52,20 @@ public class `batching conditional hydration with list condition field snapshot` ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(ids: ["barId2"]) { + | query (${'$'}v0: [ID]) { + | barsById(ids: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with multiple true conditions takes first snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with multiple true conditions takes first snapshot.kt index 71be58355..ade934d2a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with multiple true conditions takes first snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration with multiple true conditions takes first snapshot.kt @@ -56,14 +56,21 @@ public class `batching conditional hydration with multiple true conditions takes ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(ids: ["barId1", "barId2"]) { + | query (${'$'}v0: [ID]) { + | barsById(ids: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with int type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with int type snapshot.kt index 68eca2841..d226fccde 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with int type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with int type snapshot.kt @@ -52,14 +52,20 @@ public class `batching conditional hydration works with int type snapshot` : Tes ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(ids: [2]) { + | query (${'$'}v0: [Int]) { + | barsById(ids: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | 2 + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with matches condition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with matches condition snapshot.kt index 615477d62..68d0967be 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with matches condition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with matches condition snapshot.kt @@ -56,14 +56,21 @@ public class `batching conditional hydration works with matches condition snapsh ExpectedServiceCall( service = "service2", query = """ - | { - | othersById(ids: ["barId1", "barId2"]) { + | query (${'$'}v0: [ID]) { + | othersById(ids: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with startsWith condition snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with startsWith condition snapshot.kt index 996405bb5..8367352df 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with startsWith condition snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching conditional hydration works with startsWith condition snapshot.kt @@ -56,14 +56,21 @@ public class `batching conditional hydration works with startsWith condition sna ExpectedServiceCall( service = "service2", query = """ - | { - | othersById(ids: ["barId1", "barId2"]) { + | query (${'$'}v0: [ID]) { + | othersById(ids: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching multiple source ids going to different services snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching multiple source ids going to different services snapshot.kt index 2e6947c75..132f5a0c9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching multiple source ids going to different services snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching multiple source ids going to different services snapshot.kt @@ -75,8 +75,8 @@ public class `batching multiple source ids going to different services snapshot` ExpectedServiceCall( service = "comments", query = """ - | { - | commentsByIds(ids: ["comment/5000", "comment/6000", "comment/9001", "comment/1234"]) { + | query (${'$'}v0: [ID!]!) { + | commentsByIds(ids: ${'$'}v0) { | __typename | content | id @@ -84,7 +84,16 @@ public class `batching multiple source ids going to different services snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "comment/5000", + | "comment/6000", + | "comment/9001", + | "comment/1234" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -123,8 +132,8 @@ public class `batching multiple source ids going to different services snapshot` ExpectedServiceCall( service = "issues", query = """ - | { - | issuesByIds(ids: ["issue/4000", "issue/8080", "issue/7496", "issue/1234"]) { + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename | id | batch_hydration__content__id: id @@ -132,7 +141,16 @@ public class `batching multiple source ids going to different services snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue/4000", + | "issue/8080", + | "issue/7496", + | "issue/1234" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching no source inputs snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching no source inputs snapshot.kt index 8e9d57cb6..3fd9b8993 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching no source inputs snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching no source inputs snapshot.kt @@ -69,8 +69,8 @@ public class `batching no source inputs snapshot` : TestSnapshot() { ExpectedServiceCall( service = "comments", query = """ - | { - | commentsByIds(ids: ["comment/9001", "comment/1234"]) { + | query (${'$'}v0: [ID!]!) { + | commentsByIds(ids: ${'$'}v0) { | __typename | content | id @@ -78,7 +78,14 @@ public class `batching no source inputs snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "comment/9001", + | "comment/1234" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,8 +112,8 @@ public class `batching no source inputs snapshot` : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issuesByIds(ids: ["issue/7496", "issue/1234"]) { + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename | id | batch_hydration__content__id: id @@ -114,7 +121,14 @@ public class `batching no source inputs snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue/7496", + | "issue/1234" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching single source id snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching single source id snapshot.kt index 3391ac6e9..e321617cd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching single source id snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/batching/batching single source id snapshot.kt @@ -63,8 +63,8 @@ public class `batching single source id snapshot` : TestSnapshot() { ExpectedServiceCall( service = "comments", query = """ - | { - | commentsByIds(ids: ["comment/1234"]) { + | query (${'$'}v0: [ID!]!) { + | commentsByIds(ids: ${'$'}v0) { | __typename | content | id @@ -72,7 +72,13 @@ public class `batching single source id snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "comment/1234" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -93,8 +99,8 @@ public class `batching single source id snapshot` : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issuesByIds(ids: ["issue/4000", "issue/8080", "issue/7496"]) { + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename | id | batch_hydration__content__id: id @@ -102,7 +108,15 @@ public class `batching single source id snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue/4000", + | "issue/8080", + | "issue/7496" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration for specific service snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration for specific service snapshot.kt index 735b33441..dd7084b7b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration for specific service snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration for specific service snapshot.kt @@ -53,14 +53,22 @@ public class `can generate legacy operation name on batch hydration for specific ExpectedServiceCall( service = "service2", query = """ - | query nadel_2_service2 { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | query nadel_2_service2(${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration snapshot.kt index 492a46e85..d5066bc0c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on batch hydration snapshot.kt @@ -52,14 +52,22 @@ public class `can generate legacy operation name on batch hydration snapshot` : ExpectedServiceCall( service = "service2", query = """ - | query nadel_2_service2 { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | query nadel_2_service2(${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on hydration snapshot.kt index 05570a433..35ed1f953 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/can generate legacy operation name on hydration snapshot.kt @@ -48,13 +48,17 @@ public class `can generate legacy operation name on hydration snapshot` : TestSn ExpectedServiceCall( service = "service2", query = """ - | query nadel_2_service2_TestFoo { - | barById(id: "barId") { + | query nadel_2_service2_TestFoo(${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by doesnt use all input fields in the inputIdentifiedBy argument snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by doesnt use all input fields in the inputIdentifiedBy argument snapshot.kt index 4a386c66b..606efe932 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by doesnt use all input fields in the inputIdentifiedBy argument snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by doesnt use all input fields in the inputIdentifiedBy argument snapshot.kt @@ -94,15 +94,36 @@ public class ExpectedServiceCall( service = "Issue", query = """ - | { - | issues(issuesInput: [{id : "ISSUE-0", site : "CLOUD-0"}, {id : "ISSUE-1", site : "CLOUD-0"}, {id : "ISSUE-2", site : "CLOUD-0"}, {id : "ISSUE-3", site : "CLOUD-0"}]) { + | query (${'$'}v0: [IssueInput!]) { + | issues(issuesInput: ${'$'}v0) { | description | issueId | batch_hydration__issue__issueId: issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "id": "ISSUE-0", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-1", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-2", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-3", + | "site": "CLOUD-0" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by hydration batching returns null batch snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by hydration batching returns null batch snapshot.kt index 03ffbc62b..2f655ecdd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by hydration batching returns null batch snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by hydration batching returns null batch snapshot.kt @@ -53,14 +53,22 @@ public class `complex identified by hydration batching returns null batch snapsh ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by snapshot.kt index 2cb28adff..6044d498e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by snapshot.kt @@ -106,8 +106,8 @@ public class `complex identified by snapshot` : TestSnapshot() { ExpectedServiceCall( service = "UserService", query = """ - | { - | users(id: [{site : "hello", userId : "USER-1"}, {site : "hello", userId : "USER-3"}, {site : "jdog", userId : "USER-2"}, {site : "hello", userId : "USER-4"}]) { + | query (${'$'}v0: [UserInput]) { + | users(id: ${'$'}v0) { | id | batch_hydration__author__id: id | name @@ -115,7 +115,28 @@ public class `complex identified by snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "userId": "USER-1", + | "site": "hello" + | }, + | { + | "userId": "USER-3", + | "site": "hello" + | }, + | { + | "userId": "USER-2", + | "site": "jdog" + | }, + | { + | "userId": "USER-4", + | "site": "hello" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -154,8 +175,8 @@ public class `complex identified by snapshot` : TestSnapshot() { ExpectedServiceCall( service = "UserService", query = """ - | { - | users(id: [{site : "hello", userId : "USER-5"}, {site : "hello", userId : "USER-2"}]) { + | query (${'$'}v0: [UserInput]) { + | users(id: ${'$'}v0) { | id | batch_hydration__author__id: id | name @@ -163,7 +184,20 @@ public class `complex identified by snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "userId": "USER-5", + | "site": "hello" + | }, + | { + | "userId": "USER-2", + | "site": "hello" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations and a deep rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations and a deep rename snapshot.kt index a6f2f8290..140ef3d17 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations and a deep rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations and a deep rename snapshot.kt @@ -25,14 +25,21 @@ public class `complex identified by uses same source for hydrations and a deep r ExpectedServiceCall( service = "Foo", query = """ - | { - | details(detailIds: ["Foo-1", "Foo-2"]) { + | query (${'$'}v0: [ID]) { + | details(detailIds: ${'$'}v0) { | batch_hydration__detail__detailId: detailId | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-1", + | "Foo-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -55,14 +62,20 @@ public class `complex identified by uses same source for hydrations and a deep r ExpectedServiceCall( service = "Foo", query = """ - | { - | details(detailIds: ["Foo-3"]) { + | query (${'$'}v0: [ID]) { + | details(detailIds: ${'$'}v0) { | batch_hydration__detail__detailId: detailId | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -139,14 +152,21 @@ public class `complex identified by uses same source for hydrations and a deep r ExpectedServiceCall( service = "Foo", query = """ - | { - | issues(issueIds: ["Foo-1", "Foo-2"]) { + | query (${'$'}v0: [ID]) { + | issues(issueIds: ${'$'}v0) { | field | batch_hydration__issue__issueId: issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-1", + | "Foo-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -169,14 +189,20 @@ public class `complex identified by uses same source for hydrations and a deep r ExpectedServiceCall( service = "Foo", query = """ - | { - | issues(issueIds: ["Foo-3"]) { + | query (${'$'}v0: [ID]) { + | issues(issueIds: ${'$'}v0) { | field | batch_hydration__issue__issueId: issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations snapshot.kt index 4b941b037..db7a012e2 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by uses same source for hydrations snapshot.kt @@ -24,14 +24,21 @@ public class `complex identified by uses same source for hydrations snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | details(detailIds: ["Foo-1", "Foo-2"]) { + | query (${'$'}v0: [ID]) { + | details(detailIds: ${'$'}v0) { | batch_hydration__detail__detailId: detailId | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-1", + | "Foo-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +61,20 @@ public class `complex identified by uses same source for hydrations snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | details(detailIds: ["Foo-3"]) { + | query (${'$'}v0: [ID]) { + | details(detailIds: ${'$'}v0) { | batch_hydration__detail__detailId: detailId | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -122,14 +135,21 @@ public class `complex identified by uses same source for hydrations snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | issues(issueIds: ["Foo-1", "Foo-2"]) { + | query (${'$'}v0: [ID]) { + | issues(issueIds: ${'$'}v0) { | field | batch_hydration__issue__issueId: issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-1", + | "Foo-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -152,14 +172,20 @@ public class `complex identified by uses same source for hydrations snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | issues(issueIds: ["Foo-3"]) { + | query (${'$'}v0: [ID]) { + | issues(issueIds: ${'$'}v0) { | field | batch_hydration__issue__issueId: issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with indexed hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with indexed hydration snapshot.kt index 637c95340..7ec56563c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with indexed hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with indexed hydration snapshot.kt @@ -92,14 +92,35 @@ public class `complex identified by with indexed hydration snapshot` : TestSnaps ExpectedServiceCall( service = "Issue", query = """ - | { - | issues(issuesInput: [{id : "ISSUE-0", site : "CLOUD-0"}, {id : "ISSUE-1", site : "CLOUD-0"}, {id : "ISSUE-2", site : "CLOUD-0"}, {id : "ISSUE-3", site : "CLOUD-0"}]) { + | query (${'$'}v0: [IssueInput!]) { + | issues(issuesInput: ${'$'}v0) { | description | issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "id": "ISSUE-0", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-1", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-2", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-3", + | "site": "CLOUD-0" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with list source id snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with list source id snapshot.kt index d345e4b55..d7bd66466 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with list source id snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with list source id snapshot.kt @@ -92,8 +92,8 @@ public class `complex identified by with list source id snapshot` : TestSnapshot ExpectedServiceCall( service = "UserService", query = """ - | { - | users(id: [{site : "hello", userId : "USER-1"}, {site : "hello", userId : "USER-2"}, {site : "hello", userId : "USER-3"}]) { + | query (${'$'}v0: [UserInput]) { + | users(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name @@ -101,7 +101,24 @@ public class `complex identified by with list source id snapshot` : TestSnapshot | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "userId": "USER-1", + | "site": "hello" + | }, + | { + | "userId": "USER-2", + | "site": "hello" + | }, + | { + | "userId": "USER-3", + | "site": "hello" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -134,8 +151,8 @@ public class `complex identified by with list source id snapshot` : TestSnapshot ExpectedServiceCall( service = "UserService", query = """ - | { - | users(id: [{site : "jdog", userId : "USER-2"}, {site : "hello", userId : "USER-4"}, {site : "hello", userId : "USER-5"}]) { + | query (${'$'}v0: [UserInput]) { + | users(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name @@ -143,7 +160,24 @@ public class `complex identified by with list source id snapshot` : TestSnapshot | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "userId": "USER-2", + | "site": "jdog" + | }, + | { + | "userId": "USER-4", + | "site": "hello" + | }, + | { + | "userId": "USER-5", + | "site": "hello" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with some null source ids snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with some null source ids snapshot.kt index 5ddd967e1..3548cf30b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with some null source ids snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex identified by with some null source ids snapshot.kt @@ -86,8 +86,8 @@ public class `complex identified by with some null source ids snapshot` : TestSn ExpectedServiceCall( service = "UserService", query = """ - | { - | users(id: [{site : "hello", userId : "USER-2"}, {site : "hello", userId : "USER-3"}, {site : "jdog", userId : "USER-2"}]) { + | query (${'$'}v0: [UserInput]) { + | users(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name @@ -95,7 +95,24 @@ public class `complex identified by with some null source ids snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "userId": "USER-2", + | "site": "hello" + | }, + | { + | "userId": "USER-3", + | "site": "hello" + | }, + | { + | "userId": "USER-2", + | "site": "jdog" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -128,8 +145,8 @@ public class `complex identified by with some null source ids snapshot` : TestSn ExpectedServiceCall( service = "UserService", query = """ - | { - | users(id: [{site : "hello", userId : "USER-5"}]) { + | query (${'$'}v0: [UserInput]) { + | users(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name @@ -137,7 +154,16 @@ public class `complex identified by with some null source ids snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "userId": "USER-5", + | "site": "hello" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex input object with indexed hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex input object with indexed hydration snapshot.kt index aaadf5b8f..935f33195 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex input object with indexed hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/complex identified by/complex input object with indexed hydration snapshot.kt @@ -92,14 +92,35 @@ public class `complex input object with indexed hydration snapshot` : TestSnapsh ExpectedServiceCall( service = "Issue", query = """ - | { - | issues(issuesInput: [{id : "ISSUE-0", site : "CLOUD-0"}, {id : "ISSUE-1", site : "CLOUD-0"}, {id : "ISSUE-2", site : "CLOUD-0"}, {id : "ISSUE-3", site : "CLOUD-0"}]) { + | query (${'$'}v0: [IssueInput!]) { + | issues(issuesInput: ${'$'}v0) { | description | issueId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "id": "ISSUE-0", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-1", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-2", + | "site": "CLOUD-0" + | }, + | { + | "id": "ISSUE-3", + | "site": "CLOUD-0" + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration equals predicate works with integer type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration equals predicate works with integer type snapshot.kt index 514665b55..7be16424b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration equals predicate works with integer type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration equals predicate works with integer type snapshot.kt @@ -50,13 +50,17 @@ public class `conditional hydration equals predicate works with integer type sna ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "BAR_B") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "BAR_B" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration matches predicate works with id type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration matches predicate works with id type snapshot.kt index 549f7eb06..a50d0c1ce 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration matches predicate works with id type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration matches predicate works with id type snapshot.kt @@ -50,13 +50,17 @@ public class `conditional hydration matches predicate works with id type snapsho ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "BAR_B") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "BAR_B" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration startsWith predicate works with id type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration startsWith predicate works with id type snapshot.kt index 6744b272e..a8a00a91e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration startsWith predicate works with id type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/conditional hydration startsWith predicate works with id type snapshot.kt @@ -50,13 +50,17 @@ public class `conditional hydration startsWith predicate works with id type snap ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "BAR_B") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "BAR_B" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to hydration snapshot.kt index 9c7093581..bed08fec6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to hydration snapshot.kt @@ -25,8 +25,8 @@ public class `expecting one child error on extensive field argument passed to hy ExpectedServiceCall( service = "TestBoard", query = """ - | { - | board(id: 1) { + | query (${'$'}v0: ID) { + | board(id: ${'$'}v0) { | __typename__rename__cardChildren: __typename | id | rename__cardChildren__issueChildren: issueChildren { @@ -41,7 +41,11 @@ public class `expecting one child error on extensive field argument passed to hy | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 1 + | } + """.trimMargin(), result = """ | { | "data": { @@ -87,14 +91,22 @@ public class `expecting one child error on extensive field argument passed to hy ExpectedServiceCall( service = "Users", query = """ - | { - | users(accountIds: ["1", "2", "3"]) { + | query (${'$'}v0: [ID]) { + | users(accountIds: ${'$'}v0) { | accountId | batch_hydration__assignee__accountId: accountId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2", + | "3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to synthetic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to synthetic hydration snapshot.kt index d1a1510e8..7a9af5b39 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to synthetic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/expecting one child error on extensive field argument passed to synthetic hydration snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "TestBoard", query = """ - | { - | board(id: 1) { + | query (${'$'}v0: ID) { + | board(id: ${'$'}v0) { | __typename__rename__cardChildren: __typename | id | rename__cardChildren__issueChildren: issueChildren { @@ -41,7 +41,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 1 + | } + """.trimMargin(), result = """ | { | "data": { @@ -84,16 +88,24 @@ public class ExpectedServiceCall( service = "Users", query = """ - | { + | query (${'$'}v0: [ID]) { | usersQuery { - | users(accountIds: ["1", "2", "3"]) { + | users(accountIds: ${'$'}v0) { | accountId | batch_hydration__assignee__accountId: accountId | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2", + | "3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration batching returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration batching returns null snapshot.kt index f0f9e31f8..f0c152f61 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration batching returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration batching returns null snapshot.kt @@ -52,14 +52,22 @@ public class `hydration batching returns null snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call forwards error snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call forwards error snapshot.kt index c870216e0..e07f7ee99 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call forwards error snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call forwards error snapshot.kt @@ -48,13 +48,17 @@ public class `hydration call forwards error snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId1") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId1" + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call over itself with renamed types snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call over itself with renamed types snapshot.kt index b1838fd85..f5449d6eb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call over itself with renamed types snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call over itself with renamed types snapshot.kt @@ -24,15 +24,23 @@ public class `hydration call over itself with renamed types snapshot` : TestSnap ExpectedServiceCall( service = "testing", query = """ - | { - | characters(ids: ["C1", "C2", "C3"]) { + | query (${'$'}v0: [ID!]!) { + | characters(ids: ${'$'}v0) { | id | batch_hydration__characters__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "C1", + | "C2", + | "C3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument snapshot.kt index abc200093..345573a6c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument snapshot.kt @@ -53,14 +53,21 @@ public class `hydration call with argument value from original field argument sn ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(extraArg: "extraArg", id: ["USER-1"]) { + | query (${'$'}v0: String, ${'$'}v1: [ID]) { + | usersByIds(extraArg: ${'$'}v0, id: ${'$'}v1) { | batch_hydration__author__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "extraArg", + | "v1": [ + | "USER-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part and synthetic field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part and synthetic field snapshot.kt index acb687d37..bdbe085ee 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part and synthetic field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part and synthetic field snapshot.kt @@ -62,9 +62,9 @@ public class `hydration call with fragments in the hydrated part and synthetic f ExpectedServiceCall( service = "UserService", query = """ - | { + | query (${'$'}v0: [ID]) { | userQuery { - | usersByIds(id: ["USER-1", "USER-2"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name @@ -72,7 +72,14 @@ public class `hydration call with fragments in the hydrated part and synthetic f | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -99,16 +106,22 @@ public class `hydration call with fragments in the hydrated part and synthetic f ExpectedServiceCall( service = "UserService", query = """ - | { + | query (${'$'}v0: [ID]) { | userQuery { - | usersByIds(id: ["USER-1"]) { + | usersByIds(id: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part snapshot.kt index e062d88d0..44a8d49f9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with fragments in the hydrated part snapshot.kt @@ -61,15 +61,22 @@ public class `hydration call with fragments in the hydrated part snapshot` : Tes ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -94,14 +101,20 @@ public class `hydration call with fragments in the hydrated part snapshot` : Tes ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with two argument values from original field arguments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with two argument values from original field arguments snapshot.kt index 88f824922..5a2bb5bd9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with two argument values from original field arguments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with two argument values from original field arguments snapshot.kt @@ -53,14 +53,22 @@ public class `hydration call with two argument values from original field argume ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(extraArg1: "extraArg1", extraArg2: 10, id: ["USER-1"]) { + | query (${'$'}v0: String, ${'$'}v1: Int, ${'$'}v2: [ID]) { + | usersByIds(extraArg1: ${'$'}v0, extraArg2: ${'$'}v1, id: ${'$'}v2) { | batch_hydration__author__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "extraArg1", + | "v1": 10, + | "v2": [ + | "USER-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface snapshot.kt index 94e72a46e..8e426f508 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface snapshot.kt @@ -24,8 +24,8 @@ public class `hydration from field in interface snapshot` : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "1") { + | query (${'$'}v0: ID) { + | issue(id: ${'$'}v0) { | __typename__hydration__issueAuthor: __typename | hydration__issueAuthor__author: author { | userId @@ -34,7 +34,11 @@ public class `hydration from field in interface snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,13 +58,17 @@ public class `hydration from field in interface snapshot` : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | user(id: "1001") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1001" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface with type rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface with type rename snapshot.kt index 09d646733..69e1f4a22 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface with type rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration from field in interface with type rename snapshot.kt @@ -24,8 +24,8 @@ public class `hydration from field in interface with type rename snapshot` : Tes ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "1") { + | query (${'$'}v0: ID) { + | issue(id: ${'$'}v0) { | __typename__hydration__issueAuthor: __typename | hydration__issueAuthor__author: author { | userId @@ -34,7 +34,11 @@ public class `hydration from field in interface with type rename snapshot` : Tes | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,13 +58,17 @@ public class `hydration from field in interface with type rename snapshot` : Tes ExpectedServiceCall( service = "users", query = """ - | { - | user(id: "1001") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1001" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration inside a renamed field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration inside a renamed field snapshot.kt index b4414c084..9783f6508 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration inside a renamed field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration inside a renamed field snapshot.kt @@ -24,13 +24,17 @@ public class `hydration inside a renamed field snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Bar", query = """ - | { - | barById(id: "hydrated-bar") { + | query (${'$'}v0: ID!) { + | barById(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "hydrated-bar" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list input snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list input snapshot.kt index 8cb1d6a34..abc1d650c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list input snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list input snapshot.kt @@ -52,14 +52,18 @@ public class `hydration list input snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId1") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -76,14 +80,18 @@ public class `hydration list input snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId2") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId2" + | } + """.trimMargin(), result = """ | { | "data": { @@ -100,14 +108,18 @@ public class `hydration list input snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId3") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId3" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching forwards error snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching forwards error snapshot.kt index 4ed2b56f0..e9499794c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching forwards error snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching forwards error snapshot.kt @@ -52,14 +52,22 @@ public class `hydration list with batching forwards error snapshot` : TestSnapsh ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching snapshot.kt index a65b30ef5..1847e4ffd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with batching snapshot.kt @@ -52,14 +52,22 @@ public class `hydration list with batching snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with one element snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with one element snapshot.kt index 1ac4827b7..54761d5ec 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with one element snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration list with one element snapshot.kt @@ -50,14 +50,18 @@ public class `hydration list with one element snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId1") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces asking typename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces asking typename snapshot.kt index 9d4da6fd4..c37b1061d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces asking typename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces asking typename snapshot.kt @@ -24,11 +24,15 @@ public class `hydration with interfaces asking typename snapshot` : TestSnapshot ExpectedServiceCall( service = "Issues", query = """ + | query (${'$'}v0: ID!) { + | ariById(id: ${'$'}v0) + | } + """.trimMargin(), + variables = """ | { - | ariById(id: "ari:i-always-forget-the-format/1") + | "v0": "ari:i-always-forget-the-format/1" | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces snapshot.kt index 4dcbd3dcb..3a9b658f0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with interfaces snapshot.kt @@ -24,11 +24,15 @@ public class `hydration with interfaces snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Issues", query = """ + | query (${'$'}v0: ID!) { + | idByAri(id: ${'$'}v0) + | } + """.trimMargin(), + variables = """ | { - | idByAri(id: "ari:i-always-forget-the-format/1") + | "v0": "ari:i-always-forget-the-format/1" | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with more interfaces snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with more interfaces snapshot.kt index 02edcdf85..5c2763db6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with more interfaces snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with more interfaces snapshot.kt @@ -24,11 +24,15 @@ public class `hydration with more interfaces snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Issues", query = """ + | query (${'$'}v0: ID!) { + | ariById(id: ${'$'}v0) + | } + """.trimMargin(), + variables = """ | { - | ariById(id: "Franklin") + | "v0": "Franklin" | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { @@ -90,11 +94,15 @@ public class `hydration with more interfaces snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Issues", query = """ + | query (${'$'}v0: ID!) { + | trollName(id: ${'$'}v0) + | } + """.trimMargin(), + variables = """ | { - | trollName(id: "My Arm") + | "v0": "My Arm" | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple conditions ignores false conditions snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple conditions ignores false conditions snapshot.kt index 28a894a91..1fc666d94 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple conditions ignores false conditions snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple conditions ignores false conditions snapshot.kt @@ -50,13 +50,17 @@ public class `hydration with multiple conditions ignores false conditions snapsh ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "BAR_B") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "BAR_B" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple true conditions takes first snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple true conditions takes first snapshot.kt index 8664de4b7..f74062861 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple true conditions takes first snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration with multiple true conditions takes first snapshot.kt @@ -49,13 +49,17 @@ public class `hydration with multiple true conditions takes first snapshot` : Te ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "BAR_A") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "BAR_A" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration within hydration with variables snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration within hydration with variables snapshot.kt index 0857e6691..3fe31c088 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration within hydration with variables snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration within hydration with variables snapshot.kt @@ -48,13 +48,18 @@ public class `hydration within hydration with variables snapshot` : TestSnapshot ExpectedServiceCall( service = "comments", query = """ - | { - | comments(cloudId: "CLOUD_ID-1", first: 10) { + | query (${'$'}v0: ID!, ${'$'}v1: Int) { + | comments(cloudId: ${'$'}v0, first: ${'$'}v1) { | totalCount | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "CLOUD_ID-1", + | "v1": 10 + | } + """.trimMargin(), result = """ | { | "data": { @@ -70,14 +75,18 @@ public class `hydration within hydration with variables snapshot` : TestSnapshot ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "ISSUE-1") { + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | __typename__hydration__comments: __typename | hydration__comments__cloudId: cloudId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration works when an ancestor field has been renamed snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration works when an ancestor field has been renamed snapshot.kt index c965c906b..89b7cbbe0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration works when an ancestor field has been renamed snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration works when an ancestor field has been renamed snapshot.kt @@ -24,13 +24,17 @@ public class `hydration works when an ancestor field has been renamed snapshot` ExpectedServiceCall( service = "IssueService", query = """ - | { - | issue(id: "1") { + | query (${'$'}v0: ID) { + | issue(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration all null ids snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration all null ids snapshot.kt index e346506f3..b50b095a6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration all null ids snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration all null ids snapshot.kt @@ -24,15 +24,19 @@ public class `index hydration all null ids snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Issues", query = """ - | { - | issueById(id: "10000") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__batch_hydration__collaborators: __typename | batch_hydration__collaborators__collaboratorIds: collaboratorIds | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "10000" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration with partitioned inputs snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration with partitioned inputs snapshot.kt index 9c96ec3ba..3fafd49fb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration with partitioned inputs snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index hydration with partitioned inputs snapshot.kt @@ -70,13 +70,20 @@ public class `index hydration with partitioned inputs snapshot` : TestSnapshot() ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["site-1/user-1", "site-1/user-3"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "site-1/user-1", + | "site-1/user-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -97,13 +104,19 @@ public class `index hydration with partitioned inputs snapshot` : TestSnapshot() ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["site-1/user-5"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "site-1/user-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -121,13 +134,20 @@ public class `index hydration with partitioned inputs snapshot` : TestSnapshot() ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["site-2/user-2", "site-2/user-4"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "site-2/user-2", + | "site-2/user-4" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index one batch returns errors snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index one batch returns errors snapshot.kt index 1bcb78380..95d716228 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index one batch returns errors snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index one batch returns errors snapshot.kt @@ -70,13 +70,20 @@ public class `hydration matching using index one batch returns errors snapshot` ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["1", "2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -95,13 +102,19 @@ public class `hydration matching using index one batch returns errors snapshot` ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["4"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "4" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning errors snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning errors snapshot.kt index 2582c38c4..9b16bcaba 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning errors snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning errors snapshot.kt @@ -62,13 +62,20 @@ public class `hydration matching using index returning errors snapshot` : TestSn ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["1", "2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null elements snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null elements snapshot.kt index e25d13c60..e72b0a8fd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null elements snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null elements snapshot.kt @@ -62,13 +62,20 @@ public class `hydration matching using index returning null elements snapshot` : ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["1", "2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null snapshot.kt index 1a6c7e8bf..7d205ef4b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index returning null snapshot.kt @@ -62,13 +62,20 @@ public class `hydration matching using index returning null snapshot` : TestSnap ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["1", "2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index snapshot.kt index 6cf274a12..43c955ecd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index snapshot.kt @@ -62,13 +62,20 @@ public class `hydration matching using index snapshot` : TestSnapshot() { ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["1", "2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists snapshot.kt index bd11fe8b4..4628a0476 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists snapshot.kt @@ -57,13 +57,20 @@ public class `hydration matching using index with lists snapshot` : TestSnapshot ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIssueIds(issueIds: ["ISSUE-1", "ISSUE-2"]) { + | query (${'$'}v0: [ID]) { + | usersByIssueIds(issueIds: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ISSUE-1", + | "ISSUE-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists with hydration field not exposed snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists with hydration field not exposed snapshot.kt index ce2b2e75e..ba5539856 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists with hydration field not exposed snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with lists with hydration field not exposed snapshot.kt @@ -58,13 +58,20 @@ public class `hydration matching using index with lists with hydration field not ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIssueIds(issueIds: ["ISSUE-1", "ISSUE-2"]) { + | query (${'$'}v0: [ID]) { + | usersByIssueIds(issueIds: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ISSUE-1", + | "ISSUE-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with null input nodes snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with null input nodes snapshot.kt index 2d2ab3d37..789714197 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with null input nodes snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/index/hydration matching using index with null input nodes snapshot.kt @@ -62,13 +62,20 @@ public class `hydration matching using index with null input nodes snapshot` : T ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(ids: ["1", "2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(ids: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "1", + | "2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/multiple conditional hydrations with different source fields snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/multiple conditional hydrations with different source fields snapshot.kt index ccda8529a..183c2c609 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/multiple conditional hydrations with different source fields snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/multiple conditional hydrations with different source fields snapshot.kt @@ -51,13 +51,17 @@ public class `multiple conditional hydrations with different source fields snaps ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "BAR_B") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "BAR_B" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nested list hydration under a renamed top level field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nested list hydration under a renamed top level field snapshot.kt index cb10a5325..32f04108d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nested list hydration under a renamed top level field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nested list hydration under a renamed top level field snapshot.kt @@ -24,8 +24,8 @@ public class `nested list hydration under a renamed top level field snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | connection(id: "ID") { + | query (${'$'}v0: ID) { + | connection(id: ${'$'}v0) { | __typename__hydration__nodes: __typename | hydration__nodes__edges: edges { | node @@ -33,7 +33,11 @@ public class `nested list hydration under a renamed top level field snapshot` : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ID" + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +58,18 @@ public class `nested list hydration under a renamed top level field snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | node(id: "1") { + | query (${'$'}v0: ID) { + | node(id: ${'$'}v0) { | __typename__hydration__space: __typename | hydration__space__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -102,13 +110,17 @@ public class `nested list hydration under a renamed top level field snapshot` : ExpectedServiceCall( service = "Foo", query = """ - | { - | space(id: "1a") { + | query (${'$'}v0: ID) { + | space(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1a" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/new batched with null value in source array snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/new batched with null value in source array snapshot.kt index 86f6d4e6c..3b5a3cfc8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/new batched with null value in source array snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/new batched with null value in source array snapshot.kt @@ -24,15 +24,19 @@ public class `new batched with null value in source array snapshot` : TestSnapsh ExpectedServiceCall( service = "Issues", query = """ - | { - | issueById(id: "10000") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__batch_hydration__collaborators: __typename | batch_hydration__collaborators__collaboratorIds: collaboratorIds | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "10000" + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,15 +58,22 @@ public class `new batched with null value in source array snapshot` : TestSnapsh ExpectedServiceCall( service = "Users", query = """ - | { - | usersByIds(ids: ["100", "200"]) { + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | __typename | batch_hydration__collaborators__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "100", + | "200" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nullable argument for hydration is missing snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nullable argument for hydration is missing snapshot.kt index 750f2a2ef..6ae282ce5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nullable argument for hydration is missing snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/nullable argument for hydration is missing snapshot.kt @@ -48,13 +48,17 @@ public class `nullable argument for hydration is missing snapshot` : TestSnapsho ExpectedServiceCall( service = "comments", query = """ - | { - | comments(cloudId: "CLOUD_ID-1") { + | query (${'$'}v0: ID!) { + | comments(cloudId: ${'$'}v0) { | totalCount | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "CLOUD_ID-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -70,14 +74,18 @@ public class `nullable argument for hydration is missing snapshot` : TestSnapsho ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "ISSUE-1") { + | query (${'$'}v0: ID) { + | issue(id: ${'$'}v0) { | __typename__hydration__comments: __typename | hydration__comments__cloudId: cloudId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with fragments defined snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with fragments defined snapshot.kt index 5a8a839f5..16b82d2fa 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with fragments defined snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with fragments defined snapshot.kt @@ -48,14 +48,18 @@ public class `one hydration call with fragments defined snapshot` : TestSnapshot ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with input value having longer path snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with input value having longer path snapshot.kt index 4b0b4bd0c..9c95607ef 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with input value having longer path snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with input value having longer path snapshot.kt @@ -52,13 +52,17 @@ public class `one hydration call with input value having longer path snapshot` : ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with longer path arguments and merged fields snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with longer path arguments and merged fields snapshot.kt index ebc4e1138..7a61e3163 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with longer path arguments and merged fields snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with longer path arguments and merged fields snapshot.kt @@ -62,15 +62,22 @@ public class `one hydration call with longer path arguments and merged fields sn ExpectedServiceCall( service = "UserService", query = """ - | { - | usersByIds(id: ["USER-1", "USER-2"]) { + | query (${'$'}v0: [ID]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with variables defined snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with variables defined snapshot.kt index b9b6c5190..a8595ec88 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with variables defined snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one hydration call with variables defined snapshot.kt @@ -48,14 +48,18 @@ public class `one hydration call with variables defined snapshot` : TestSnapshot ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one synthetic hydration call with longer path arguments and merged fields and renamed type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one synthetic hydration call with longer path arguments and merged fields and renamed type snapshot.kt index 7a0d3220e..2fa435c38 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one synthetic hydration call with longer path arguments and merged fields and renamed type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/one synthetic hydration call with longer path arguments and merged fields and renamed type snapshot.kt @@ -63,9 +63,9 @@ public class ExpectedServiceCall( service = "UserService", query = """ - | { + | query (${'$'}v0: [ID]) { | usersQuery { - | usersByIds(id: ["USER-1", "USER-2"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | name @@ -73,7 +73,14 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service return types implement same interface snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service return types implement same interface snapshot.kt index 2941cf768..eeb8ce7db 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service return types implement same interface snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service return types implement same interface snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "bar", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -35,7 +35,14 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -62,8 +69,8 @@ public class ExpectedServiceCall( service = "bar", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -71,7 +78,14 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service snapshot.kt index c21116450..577bfaac1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration actor fields are in the same service snapshot.kt @@ -25,8 +25,8 @@ public class `batch polymorphic hydration actor fields are in the same service s ExpectedServiceCall( service = "bar", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -34,7 +34,14 @@ public class `batch polymorphic hydration actor fields are in the same service s | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -61,8 +68,8 @@ public class `batch polymorphic hydration actor fields are in the same service s ExpectedServiceCall( service = "bar", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -70,7 +77,14 @@ public class `batch polymorphic hydration actor fields are in the same service s | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array snapshot.kt index aef1703c5..7558b68b1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydration return null in array snapshot` : TestS ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydration return null in array snapshot` : TestS | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydration return null in array snapshot` : TestS ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -118,7 +125,14 @@ public class `batch polymorphic hydration return null in array snapshot` : TestS | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array with error snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array with error snapshot.kt index 8aa844e99..958e68b41 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array with error snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return null in array with error snapshot.kt @@ -74,8 +74,8 @@ public class `batch polymorphic hydration return null in array with error snapsh ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -83,7 +83,14 @@ public class `batch polymorphic hydration return null in array with error snapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -110,8 +117,8 @@ public class `batch polymorphic hydration return null in array with error snapsh ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -119,7 +126,14 @@ public class `batch polymorphic hydration return null in array with error snapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null and error snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null and error snapshot.kt index 3408fc5e4..acc257061 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null and error snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null and error snapshot.kt @@ -74,8 +74,8 @@ public class `batch polymorphic hydration return top level null and error snapsh ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -83,7 +83,14 @@ public class `batch polymorphic hydration return top level null and error snapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -110,8 +117,8 @@ public class `batch polymorphic hydration return top level null and error snapsh ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -119,7 +126,14 @@ public class `batch polymorphic hydration return top level null and error snapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null snapshot.kt index 8c3532c31..acbc63970 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration return top level null snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydration return top level null snapshot` : Test ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydration return top level null snapshot` : Test | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydration return top level null snapshot` : Test ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -118,7 +125,14 @@ public class `batch polymorphic hydration return top level null snapshot` : Test | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration snapshot.kt index 5a6a56ebf..b0b7f24a5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydration snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -118,7 +125,14 @@ public class `batch polymorphic hydration snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration when hook returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration when hook returns null snapshot.kt index caca133d1..7190e0f12 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration when hook returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration when hook returns null snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydration when hook returns null snapshot` : Tes ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydration when hook returns null snapshot` : Tes | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydration when hook returns null snapshot` : Tes ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -118,7 +125,13 @@ public class `batch polymorphic hydration when hook returns null snapshot` : Tes | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration where only one type is queried snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration where only one type is queried snapshot.kt index 1467dac64..d056f0eb1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration where only one type is queried snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration where only one type is queried snapshot.kt @@ -68,13 +68,19 @@ public class `batch polymorphic hydration where only one type is queried snapsho ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | batch_hydration__data__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -92,8 +98,8 @@ public class `batch polymorphic hydration where only one type is queried snapsho ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["DOG-0", "FISH-0", "DOG-1", "FISH-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | ... on Dog { | batch_hydration__data__id: id | } @@ -106,7 +112,16 @@ public class `batch polymorphic hydration where only one type is queried snapsho | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "DOG-0", + | "FISH-0", + | "DOG-1", + | "FISH-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with conditions snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with conditions snapshot.kt index d7e2ce299..d26c3e2fb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with conditions snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with conditions snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydration with conditions snapshot` : TestSnapsh ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydration with conditions snapshot` : TestSnapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydration with conditions snapshot` : TestSnapsh ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -118,7 +125,14 @@ public class `batch polymorphic hydration with conditions snapshot` : TestSnapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with interfaces snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with interfaces snapshot.kt index 69054be8a..aad8520e9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with interfaces snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with interfaces snapshot.kt @@ -79,8 +79,8 @@ public class `batch polymorphic hydration with interfaces snapshot` : TestSnapsh ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -88,7 +88,13 @@ public class `batch polymorphic hydration with interfaces snapshot` : TestSnapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +115,8 @@ public class `batch polymorphic hydration with interfaces snapshot` : TestSnapsh ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["DOG-0", "FISH-0", "DOG-1", "FISH-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -123,7 +129,16 @@ public class `batch polymorphic hydration with interfaces snapshot` : TestSnapsh | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "DOG-0", + | "FISH-0", + | "DOG-1", + | "FISH-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with lots of renames snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with lots of renames snapshot.kt index db054128c..31e2cfa36 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with lots of renames snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with lots of renames snapshot.kt @@ -24,8 +24,8 @@ public class `batch polymorphic hydration with lots of renames snapshot` : TestS ExpectedServiceCall( service = "bar", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | __typename__rename__id: __typename | batch_hydration__data__hiddenId: hiddenId @@ -34,7 +34,14 @@ public class `batch polymorphic hydration with lots of renames snapshot` : TestS | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -63,8 +70,8 @@ public class `batch polymorphic hydration with lots of renames snapshot` : TestS ExpectedServiceCall( service = "bar", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | __typename__rename__id: __typename | __typename__rename__breed: __typename @@ -74,7 +81,14 @@ public class `batch polymorphic hydration with lots of renames snapshot` : TestS | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with rename snapshot.kt index 60b26dde6..3a3bdb20b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with rename snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydration with rename snapshot` : TestSnapshot() ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydration with rename snapshot` : TestSnapshot() | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydration with rename snapshot` : TestSnapshot() ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | __typename__rename__breed: __typename | id @@ -119,7 +126,14 @@ public class `batch polymorphic hydration with rename snapshot` : TestSnapshot() | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with unions snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with unions snapshot.kt index cf7fd4d4c..1a5f1a679 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with unions snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydration with unions snapshot.kt @@ -79,8 +79,8 @@ public class `batch polymorphic hydration with unions snapshot` : TestSnapshot() ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -88,7 +88,13 @@ public class `batch polymorphic hydration with unions snapshot` : TestSnapshot() | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +115,8 @@ public class `batch polymorphic hydration with unions snapshot` : TestSnapshot() ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["DOG-0", "FISH-0", "DOG-1", "FISH-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | ... on Dog { | breed @@ -125,7 +131,16 @@ public class `batch polymorphic hydration with unions snapshot` : TestSnapshot() | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "DOG-0", + | "FISH-0", + | "DOG-1", + | "FISH-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydrations are executed in parallel snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydrations are executed in parallel snapshot.kt index 34b719a0f..fc6feb4cb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydrations are executed in parallel snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/batch polymorphic hydrations are executed in parallel snapshot.kt @@ -73,8 +73,8 @@ public class `batch polymorphic hydrations are executed in parallel snapshot` : ExpectedServiceCall( service = "people", query = """ - | { - | humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + | query (${'$'}v0: [ID]) { + | humanById(ids: ${'$'}v0) { | __typename | id | batch_hydration__data__id: id @@ -82,7 +82,14 @@ public class `batch polymorphic hydrations are executed in parallel snapshot` : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "HUMAN-0", + | "HUMAN-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,8 +116,8 @@ public class `batch polymorphic hydrations are executed in parallel snapshot` : ExpectedServiceCall( service = "pets", query = """ - | { - | petById(ids: ["PET-0", "PET-1"]) { + | query (${'$'}v0: [ID]) { + | petById(ids: ${'$'}v0) { | __typename | breed | id @@ -118,7 +125,14 @@ public class `batch polymorphic hydrations are executed in parallel snapshot` : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "PET-0", + | "PET-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/polymorphic hydration instructions use different inputs snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/polymorphic hydration instructions use different inputs snapshot.kt index 31f02394a..1c9e9cc22 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/polymorphic hydration instructions use different inputs snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/polymorphic hydration instructions use different inputs snapshot.kt @@ -24,15 +24,21 @@ public class `polymorphic hydration instructions use different inputs snapshot` ExpectedServiceCall( service = "Dogs", query = """ - | { - | dogsByIds(ids: ["good-boye-1"]) { + | query (${'$'}v0: [ID!]!) { + | dogsByIds(ids: ${'$'}v0) { | __typename | batch_hydration__animal__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "good-boye-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -52,8 +58,8 @@ public class `polymorphic hydration instructions use different inputs snapshot` ExpectedServiceCall( service = "Pets", query = """ - | { - | petsByIds(ids: ["good-boye-1", "tall-boye-9"]) { + | query (${'$'}v0: [ID!]!) { + | petsByIds(ids: ${'$'}v0) { | __typename__batch_hydration__animal: __typename | batch_hydration__animal__animalId: animalId | batch_hydration__animal__animalId: animalId @@ -65,7 +71,14 @@ public class `polymorphic hydration instructions use different inputs snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "good-boye-1", + | "tall-boye-9" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -94,8 +107,8 @@ public class `polymorphic hydration instructions use different inputs snapshot` ExpectedServiceCall( service = "Zoo", query = """ - | { - | giraffes(filters: [{birthday : 1001203200, height : 570, nickname : "Tall Boye"}]) { + | query (${'$'}v0: [GiraffeFilter]) { + | giraffes(filters: ${'$'}v0) { | __typename | birthday | batch_hydration__animal__birthday: birthday @@ -106,7 +119,17 @@ public class `polymorphic hydration instructions use different inputs snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | { + | "nickname": "Tall Boye", + | "birthday": 1001203200, + | "height": 570 + | } + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration snapshot.kt index f3580b859..d57da2a91 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration snapshot.kt @@ -61,15 +61,19 @@ public class `solitary polymorphic hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "people", query = """ - | { - | humanById(id: "HUMAN-0") { + | query (${'$'}v0: ID) { + | humanById(id: ${'$'}v0) { | __typename | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "HUMAN-0" + | } + """.trimMargin(), result = """ | { | "data": { @@ -87,15 +91,19 @@ public class `solitary polymorphic hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "pets", query = """ - | { - | petById(id: "PET-0") { + | query (${'$'}v0: ID) { + | petById(id: ${'$'}v0) { | __typename | breed | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "PET-0" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration when hook returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration when hook returns null snapshot.kt index 7a3b10c7f..41277ee29 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration when hook returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/polymorphic hydrations/solitary polymorphic hydration when hook returns null snapshot.kt @@ -61,15 +61,19 @@ public class `solitary polymorphic hydration when hook returns null snapshot` : ExpectedServiceCall( service = "people", query = """ - | { - | humanById(id: "HUMAN-0") { + | query (${'$'}v0: ID) { + | humanById(id: ${'$'}v0) { | __typename | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "HUMAN-0" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydrated interfaces work as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydrated interfaces work as expected snapshot.kt index e03ce510f..1122541b9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydrated interfaces work as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydrated interfaces work as expected snapshot.kt @@ -24,8 +24,8 @@ public class `query with hydrated interfaces work as expected snapshot` : TestSn ExpectedServiceCall( service = "OwnerService", query = """ - | query petQ { - | ownerById(id: "cruella") { + | query petQ(${'$'}v0: String) { + | ownerById(id: ${'$'}v0) { | name | ... on CaringOwner { | givesPats @@ -36,7 +36,11 @@ public class `query with hydrated interfaces work as expected snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "cruella" + | } + """.trimMargin(), result = """ | { | "data": { @@ -53,8 +57,8 @@ public class `query with hydrated interfaces work as expected snapshot` : TestSn ExpectedServiceCall( service = "OwnerService", query = """ - | query petQ { - | ownerById(id: "dearly") { + | query petQ(${'$'}v0: String) { + | ownerById(id: ${'$'}v0) { | name | ... on CaringOwner { | givesPats @@ -65,7 +69,11 @@ public class `query with hydrated interfaces work as expected snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "dearly" + | } + """.trimMargin(), result = """ | { | "data": { @@ -82,8 +90,8 @@ public class `query with hydrated interfaces work as expected snapshot` : TestSn ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | __typename__hydration__owners: __typename | name | ... on Cat { @@ -95,7 +103,11 @@ public class `query with hydrated interfaces work as expected snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydration that fail with errors are reflected in the result snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydration that fail with errors are reflected in the result snapshot.kt index a6da2a759..4d19fe25c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydration that fail with errors are reflected in the result snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with hydration that fail with errors are reflected in the result snapshot.kt @@ -25,15 +25,19 @@ public class `query with hydration that fail with errors are reflected in the re ExpectedServiceCall( service = "Bar", query = """ - | { - | barById(id: "barId123") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | __typename__hydration__nestedBar: __typename | name | hydration__nestedBar__nestedBarId: nestedBarId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId123" + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with synthetic hydration that fail with errors are reflected in the result snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with synthetic hydration that fail with errors are reflected in the result snapshot.kt index 882586541..51d3f7234 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with synthetic hydration that fail with errors are reflected in the result snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with synthetic hydration that fail with errors are reflected in the result snapshot.kt @@ -26,9 +26,9 @@ public class ExpectedServiceCall( service = "Bar", query = """ - | { + | query (${'$'}v0: ID) { | barQuery { - | barById(id: "barId123") { + | barById(id: ${'$'}v0) { | __typename__hydration__nestedBar: __typename | name | hydration__nestedBar__nestedBarId: nestedBarId @@ -36,7 +36,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId123" + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data and lots of renames snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data and lots of renames snapshot.kt index aa6266c06..7dfdcf1c0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data and lots of renames snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data and lots of renames snapshot.kt @@ -25,8 +25,8 @@ public class `query with three nested hydrations and simple data and lots of ren ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["bar1"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__rename__barName: __typename | __typename__batch_hydration__nestedBar: __typename | batch_hydration__bar__barId: barId @@ -35,7 +35,13 @@ public class `query with three nested hydrations and simple data and lots of ren | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -57,8 +63,8 @@ public class `query with three nested hydrations and simple data and lots of ren ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["nestedBar1"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__rename__barName: __typename | __typename__batch_hydration__nestedBar: __typename | batch_hydration__nestedBar__barId: barId @@ -67,7 +73,13 @@ public class `query with three nested hydrations and simple data and lots of ren | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBar1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -89,8 +101,8 @@ public class `query with three nested hydrations and simple data and lots of ren ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["nestedBarId456"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__rename__barName: __typename | __typename__rename__barDetails: __typename | batch_hydration__nestedBar__barId: barId @@ -109,7 +121,13 @@ public class `query with three nested hydrations and simple data and lots of ren | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBarId456" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data snapshot.kt index 2d523f8a2..5624e04eb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and simple data snapshot.kt @@ -24,8 +24,8 @@ public class `query with three nested hydrations and simple data snapshot` : Tes ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["bar1"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__bar__barId: barId | name @@ -33,7 +33,13 @@ public class `query with three nested hydrations and simple data snapshot` : Tes | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,8 +60,8 @@ public class `query with three nested hydrations and simple data snapshot` : Tes ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["nestedBar1"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__nestedBar__barId: barId | name @@ -63,7 +69,13 @@ public class `query with three nested hydrations and simple data snapshot` : Tes | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBar1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -84,14 +96,20 @@ public class `query with three nested hydrations and simple data snapshot` : Tes ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["nestedBarId456"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__nestedBar__barId: barId | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBarId456" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and synthetic fields snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and synthetic fields snapshot.kt index b455d719a..84ccc5c3e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and synthetic fields snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations and synthetic fields snapshot.kt @@ -24,9 +24,9 @@ public class `query with three nested hydrations and synthetic fields snapshot` ExpectedServiceCall( service = "Bar", query = """ - | { + | query (${'$'}v0: [ID]) { | barsQuery { - | barsById(id: ["bar1", "bar2"]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__bar__barId: barId | name @@ -35,7 +35,14 @@ public class `query with three nested hydrations and synthetic fields snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar1", + | "bar2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -64,9 +71,9 @@ public class `query with three nested hydrations and synthetic fields snapshot` ExpectedServiceCall( service = "Bar", query = """ - | { + | query (${'$'}v0: [ID]) { | barsQuery { - | barsById(id: ["bar3"]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__bar__barId: barId | name @@ -75,7 +82,13 @@ public class `query with three nested hydrations and synthetic fields snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -98,9 +111,9 @@ public class `query with three nested hydrations and synthetic fields snapshot` ExpectedServiceCall( service = "Bar", query = """ - | { + | query (${'$'}v0: [ID]) { | barsQuery { - | barsById(id: ["nestedBar1", "nestedBar2"]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__nestedBar__barId: barId | name @@ -109,7 +122,14 @@ public class `query with three nested hydrations and synthetic fields snapshot` | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBar1", + | "nestedBar2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -132,16 +152,22 @@ public class `query with three nested hydrations and synthetic fields snapshot` ExpectedServiceCall( service = "Bar", query = """ - | { + | query (${'$'}v0: [ID]) { | barsQuery { - | barsById(id: ["nestedBarId456"]) { + | barsById(id: ${'$'}v0) { | batch_hydration__nestedBar__barId: barId | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBarId456" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations snapshot.kt index 12b9ff9c0..9c5ac44e6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/query with three nested hydrations snapshot.kt @@ -24,8 +24,8 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["bar1", "bar2"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__bar__barId: barId | name @@ -33,7 +33,14 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar1", + | "bar2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -60,8 +67,8 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["bar3"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__bar__barId: barId | name @@ -69,7 +76,13 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -90,8 +103,8 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["nestedBar1", "nestedBar2"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | __typename__batch_hydration__nestedBar: __typename | batch_hydration__nestedBar__barId: barId | name @@ -99,7 +112,14 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBar1", + | "nestedBar2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -120,14 +140,20 @@ public class `query with three nested hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Bar", query = """ - | { - | barsById(id: ["nestedBarId456"]) { + | query (${'$'}v0: [ID]) { + | barsById(id: ${'$'}v0) { | batch_hydration__nestedBar__barId: barId | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "nestedBarId456" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/renamed and hydrated query using same underlying source snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/renamed and hydrated query using same underlying source snapshot.kt index bda57c246..4b12e4a2d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/renamed and hydrated query using same underlying source snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/renamed and hydrated query using same underlying source snapshot.kt @@ -24,13 +24,17 @@ public class `renamed and hydrated query using same underlying source snapshot` ExpectedServiceCall( service = "Foo", query = """ - | { - | detail(detailId: "ID") { + | query (${'$'}v0: ID) { + | detail(detailId: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ID" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level overlapping fields in the query snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level overlapping fields in the query snapshot.kt index 7d5289e1e..d2fa7b0cb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level overlapping fields in the query snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level overlapping fields in the query snapshot.kt @@ -49,15 +49,19 @@ public class `repeated hydrated fields on the same level overlapping fields in t ExpectedServiceCall( service = "Foo", query = """ - | { - | issue(issueId: "ISSUE-1") { + | query (${'$'}v0: ID) { + | issue(issueId: ${'$'}v0) { | desc | name | summary | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level snapshot.kt index e736aa637..4427d29b0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level snapshot.kt @@ -48,14 +48,18 @@ public class `repeated hydrated fields on the same level snapshot` : TestSnapsho ExpectedServiceCall( service = "Foo", query = """ - | { - | issue(issueId: "ISSUE-1") { + | query (${'$'}v0: ID) { + | issue(issueId: ${'$'}v0) { | desc | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ISSUE-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level when using batch hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level when using batch hydration snapshot.kt index c8ada4780..0e8ebc1d8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level when using batch hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/repeated hydrated fields on the same level when using batch hydration snapshot.kt @@ -49,15 +49,21 @@ public class `repeated hydrated fields on the same level when using batch hydrat ExpectedServiceCall( service = "Foo", query = """ - | { - | issues(issueIds: ["ISSUE-1"]) { + | query (${'$'}v0: [ID!]) { + | issues(issueIds: ${'$'}v0) { | desc | batch_hydration__issue__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ISSUE-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for hydrations snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for hydrations snapshot.kt index 5c74fced2..64387ca2b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for hydrations snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for hydrations snapshot.kt @@ -24,13 +24,17 @@ public class `same source for hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Foo", query = """ - | { - | detail(detailId: "ID") { + | query (${'$'}v0: ID) { + | detail(detailId: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ID" + | } + """.trimMargin(), result = """ | { | "data": { @@ -74,13 +78,17 @@ public class `same source for hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Foo", query = """ - | { - | issue(issueId: "ID") { + | query (${'$'}v0: ID) { + | issue(issueId: ${'$'}v0) { | field | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ID" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for nested hydrations and a rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for nested hydrations and a rename snapshot.kt index 53cb557ca..21d150509 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for nested hydrations and a rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/same source for nested hydrations and a rename snapshot.kt @@ -24,13 +24,17 @@ public class `same source for nested hydrations and a rename snapshot` : TestSn ExpectedServiceCall( service = "Foo", query = """ - | { - | detail(detailId: "ID") { + | query (${'$'}v0: ID) { + | detail(detailId: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ID" + | } + """.trimMargin(), result = """ | { | "data": { @@ -90,13 +94,17 @@ public class `same source for nested hydrations and a rename snapshot` : TestSn ExpectedServiceCall( service = "Foo", query = """ - | { - | issue(issueId: "ID") { + | query (${'$'}v0: ID) { + | issue(issueId: ${'$'}v0) { | field | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ID" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple hydration query with a synthetic field snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple hydration query with a synthetic field snapshot.kt index 78f26d865..02cb25bdb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple hydration query with a synthetic field snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple hydration query with a synthetic field snapshot.kt @@ -48,15 +48,19 @@ public class `simple hydration query with a synthetic field snapshot` : TestSnap ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: ID) { | projects { - | project(id: "project1") { + | project(id: ${'$'}v0) { | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "project1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple synthetic hydration with one service and type renaming snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple synthetic hydration with one service and type renaming snapshot.kt index 7b08adba9..d22cc2232 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple synthetic hydration with one service and type renaming snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/simple synthetic hydration with one service and type renaming snapshot.kt @@ -25,16 +25,20 @@ public class `simple synthetic hydration with one service and type renaming snap ExpectedServiceCall( service = "testing", query = """ - | { + | query (${'$'}v0: ID) { | tests { - | character(id: "C1") { + | character(id: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "C1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration batching returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration batching returns null snapshot.kt index 27dd2e3bd..956c34690 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration batching returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration batching returns null snapshot.kt @@ -52,16 +52,24 @@ public class `synthetic hydration batching returns null snapshot` : TestSnapshot ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | barsQuery { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call over itself within renamed types snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call over itself within renamed types snapshot.kt index 4b0d18176..b1356a6ae 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call over itself within renamed types snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call over itself within renamed types snapshot.kt @@ -24,9 +24,9 @@ public class `synthetic hydration call over itself within renamed types snapshot ExpectedServiceCall( service = "testing", query = """ - | { + | query (${'$'}v0: [ID!]!) { | tests { - | characters(ids: ["C1", "C2", "C3"]) { + | characters(ids: ${'$'}v0) { | id | batch_hydration__characters__id: id | name @@ -34,7 +34,15 @@ public class `synthetic hydration call over itself within renamed types snapshot | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "C1", + | "C2", + | "C3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call with two argument values from original field arguments snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call with two argument values from original field arguments snapshot.kt index 09558eaef..80968e988 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call with two argument values from original field arguments snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration call with two argument values from original field arguments snapshot.kt @@ -54,16 +54,24 @@ public class ExpectedServiceCall( service = "UserService", query = """ - | { + | query (${'$'}v0: String, ${'$'}v1: Int, ${'$'}v2: [ID]) { | usersQuery { - | usersByIds(extraArg1: "extraArg1", extraArg2: 10, id: ["USER-1"]) { + | usersByIds(extraArg1: ${'$'}v0, extraArg2: ${'$'}v1, id: ${'$'}v2) { | batch_hydration__author__id: id | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "extraArg1", + | "v1": 10, + | "v2": [ + | "USER-1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration forwards error snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration forwards error snapshot.kt index abb3e6a93..4978a0f0e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration forwards error snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration forwards error snapshot.kt @@ -48,15 +48,19 @@ public class `synthetic hydration forwards error snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: ID) { | barsQuery { - | barById(id: "barId1") { + | barById(id: ${'$'}v0) { | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId1" + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration list with batching forwards error snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration list with batching forwards error snapshot.kt index 23d7119b0..2991c7267 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration list with batching forwards error snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration list with batching forwards error snapshot.kt @@ -52,16 +52,24 @@ public class `synthetic hydration list with batching forwards error snapshot` : ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | barsQuery { - | barsById(id: ["barId1", "barId2", "barId3"]) { + | barsById(id: ${'$'}v0) { | batch_hydration__bar__id: id | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "barId1", + | "barId2", + | "barId3" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration with renamed type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration with renamed type snapshot.kt index 740ceef00..33757bc5f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration with renamed type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration with renamed type snapshot.kt @@ -24,15 +24,19 @@ public class `synthetic hydration with renamed type snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Bar", query = """ - | { + | query (${'$'}v0: ID!) { | bars { - | barById(id: "hydrated-bar") { + | barById(id: ${'$'}v0) { | id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "hydrated-bar" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration works when an ancestor field has been renamed snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration works when an ancestor field has been renamed snapshot.kt index d81ba6a07..0db5359b7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration works when an ancestor field has been renamed snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/synthetic hydration works when an ancestor field has been renamed snapshot.kt @@ -57,15 +57,19 @@ public class `synthetic hydration works when an ancestor field has been renamed ExpectedServiceCall( service = "IssueService", query = """ - | { + | query (${'$'}v0: ID) { | syntheticIssue { - | issue(id: "1") { + | issue(id: ${'$'}v0) { | id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in batched synthetic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in batched synthetic hydration snapshot.kt index 628ab19c4..c2b14b33b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in batched synthetic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in batched synthetic hydration snapshot.kt @@ -72,16 +72,24 @@ public class `top level field data returns null in batched synthetic hydration s ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | users { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -97,16 +105,23 @@ public class `top level field data returns null in batched synthetic hydration s ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | users { - | usersByIds(id: ["USER-4", "USER-5"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in synthetic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in synthetic hydration snapshot.kt index d9d5dd732..5b772a9a6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in synthetic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field data returns null in synthetic hydration snapshot.kt @@ -48,15 +48,19 @@ public class `top level field data returns null in synthetic hydration snapshot` ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: ID) { | projects { - | project(id: "project1") { + | project(id: ${'$'}v0) { | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "project1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in batched synthetic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in batched synthetic hydration snapshot.kt index 7bed5bc6d..a97d3572a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in batched synthetic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in batched synthetic hydration snapshot.kt @@ -71,16 +71,24 @@ public class `top level field is null in batched synthetic hydration snapshot` : ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | users { - | usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-1", + | "USER-2", + | "USER-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -94,16 +102,23 @@ public class `top level field is null in batched synthetic hydration snapshot` : ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: [ID]) { | users { - | usersByIds(id: ["USER-4", "USER-5"]) { + | usersByIds(id: ${'$'}v0) { | id | batch_hydration__authors__id: id | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "USER-4", + | "USER-5" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in synthetic hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in synthetic hydration snapshot.kt index 19cd4e7b1..f7ebd8d7f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in synthetic hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/top level field is null in synthetic hydration snapshot.kt @@ -48,15 +48,19 @@ public class `top level field is null in synthetic hydration snapshot` : TestSna ExpectedServiceCall( service = "service2", query = """ - | { + | query (${'$'}v0: ID) { | projects { - | project(id: "project1") { + | project(id: ${'$'}v0) { | name | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "project1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/transformer on hydration fields snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/transformer on hydration fields snapshot.kt index e5184b970..ccc46a194 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/transformer on hydration fields snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/transformer on hydration fields snapshot.kt @@ -48,13 +48,17 @@ public class `transformer on hydration fields snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "transformed-id") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "transformed-id" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/oneOf/oneOf successful snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/oneOf/oneOf successful snapshot.kt index 97c1d3d17..f7b43a177 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/oneOf/oneOf successful snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/oneOf/oneOf successful snapshot.kt @@ -24,11 +24,17 @@ public class `oneOf successful snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | query myQuery { - | search(by: {name : "Figaro"}) + | query myQuery(${'$'}v0: SearchInput) { + | search(by: ${'$'}v0) + | } + """.trimMargin(), + variables = """ + | { + | "v0": { + | "name": "Figaro" + | } | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields get typename added snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields get typename added snapshot.kt index 22b49346b..a78774eec 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields get typename added snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields get typename added snapshot.kt @@ -24,8 +24,8 @@ public class `lower level interface fields get typename added snapshot` : TestSn ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | collar { | color | } @@ -33,7 +33,11 @@ public class `lower level interface fields get typename added snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields which are renamed get typename added snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields which are renamed get typename added snapshot.kt index a111e4fb2..d5b572d02 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields which are renamed get typename added snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/lower level interface fields which are renamed get typename added snapshot.kt @@ -25,8 +25,8 @@ public class `lower level interface fields which are renamed get typename added ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | __typename__rename__collarToRenamed: __typename | name | ... on Cat { @@ -42,7 +42,11 @@ public class `lower level interface fields which are renamed get typename added | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that DONT have typename in them work as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that DONT have typename in them work as expected snapshot.kt index f9d9af702..ce15a85e4 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that DONT have typename in them work as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that DONT have typename in them work as expected snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | name | ... on Cat { | wearsBell @@ -38,7 +38,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { @@ -61,8 +65,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | raining(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | raining(isLoyal: ${'$'}v0) { | ... on Cat { | wearsBell | } @@ -72,7 +76,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have MIXED typename in them work as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have MIXED typename in them work as expected snapshot.kt index 164d6607d..085472c5b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have MIXED typename in them work as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have MIXED typename in them work as expected snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | name | ... on Cat { | wearsBell @@ -39,7 +39,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { @@ -63,8 +67,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | raining(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | raining(isLoyal: ${'$'}v0) { | __typename | ... on Cat { | wearsBell @@ -75,7 +79,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have aliased typename in fragments work as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have aliased typename in fragments work as expected snapshot.kt index e2626b1ea..1869daff7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have aliased typename in fragments work as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have aliased typename in fragments work as expected snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | name | ... on Cat { | aliasedCatTypeName: __typename @@ -40,7 +40,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in fragments work as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in fragments work as expected snapshot.kt index 089718e70..8b6846919 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in fragments work as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in fragments work as expected snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | __typename | name | ... on Cat { @@ -39,7 +39,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { @@ -64,8 +68,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | raining(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | raining(isLoyal: ${'$'}v0) { | __typename | ... on Cat { | wearsBell @@ -76,7 +80,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in them work as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in them work as expected snapshot.kt index 3d2b51d9d..be1ad70d6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in them work as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/polymorphism/query with pass through interfaces and unions that have typename in them work as expected snapshot.kt @@ -26,8 +26,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | pets(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | pets(isLoyal: ${'$'}v0) { | __typename | name | ... on Cat { @@ -39,7 +39,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { @@ -64,8 +68,8 @@ public class ExpectedServiceCall( service = "PetService", query = """ - | query petQ { - | raining(isLoyal: true) { + | query petQ(${'$'}v0: Boolean) { + | raining(isLoyal: ${'$'}v0) { | __typename | ... on Cat { | wearsBell @@ -76,7 +80,11 @@ public class | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": true + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform snapshot.kt index 7156c63b5..ba3b1646f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform snapshot.kt @@ -24,16 +24,21 @@ public class `chain rename transform snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | { - | rename__test__world: world(arg: "aaarrg") { + | query (${'$'}v0: Continent, ${'$'}v1: String) { + | rename__test__world: world(arg: ${'$'}v1) { | __typename | __typename__rename__cities: __typename | id - | rename__cities__places: places(continent: Asia) + | rename__cities__places: places(continent: ${'$'}v0) | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "Asia", + | "v1": "aaarrg" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform with type rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform with type rename snapshot.kt index a35c682bc..7b7eceeee 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform with type rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/chain rename transform with type rename snapshot.kt @@ -24,16 +24,21 @@ public class `chain rename transform with type rename snapshot` : TestSnapshot() ExpectedServiceCall( service = "MyService", query = """ - | { - | rename__test__world: world(arg: "aaarrg") { + | query (${'$'}v0: Continent, ${'$'}v1: String) { + | rename__test__world: world(arg: ${'$'}v1) { | __typename | __typename__rename__cities: __typename | id - | rename__cities__places: places(continent: Asia) + | rename__cities__places: places(continent: ${'$'}v0) | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "Asia", + | "v1": "aaarrg" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside hydration snapshot.kt index 03c6e4507..aeae508a4 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside hydration snapshot.kt @@ -48,14 +48,18 @@ public class `rename inside hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | __typename__rename__title: __typename | rename__title__name: name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside multiple hydrations snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside multiple hydrations snapshot.kt index 7b9e445c5..59dfeb4d0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside multiple hydrations snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename inside multiple hydrations snapshot.kt @@ -54,14 +54,18 @@ public class `rename inside multiple hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | __typename__rename__title: __typename | rename__title__name: name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId" + | } + """.trimMargin(), result = """ | { | "data": { @@ -78,14 +82,18 @@ public class `rename inside multiple hydrations snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "barId2") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | __typename__rename__title: __typename | rename__title__name: name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "barId2" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename on shared abstract type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename on shared abstract type snapshot.kt index 7aef99bc8..d649b7a87 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename on shared abstract type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/rename on shared abstract type snapshot.kt @@ -24,13 +24,17 @@ public class `rename on shared abstract type snapshot` : TestSnapshot() { ExpectedServiceCall( service = "worlds", query = """ - | { - | node(id: "world-1") { + | query (${'$'}v0: ID) { + | node(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "world-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/renamed top level field with argument snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/renamed top level field with argument snapshot.kt index 75ad0d607..f9733a9d8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/renamed top level field with argument snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/renamed top level field with argument snapshot.kt @@ -24,13 +24,17 @@ public class `renamed top level field with argument snapshot` : TestSnapshot() { ExpectedServiceCall( service = "MyService", query = """ - | { - | rename__renameObject__renameObjectUnderlying: renameObjectUnderlying(id: "OBJECT-001") { + | query (${'$'}v0: ID!) { + | rename__renameObject__renameObjectUnderlying: renameObjectUnderlying(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "OBJECT-001" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside batch hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside batch hydration snapshot.kt index b1602f7d9..a6f477aae 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside batch hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside batch hydration snapshot.kt @@ -24,8 +24,8 @@ public class `renamed type inside batch hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issuesByIds(id: ["issue-1", "issue-2", "issue-3"]) { + | query (${'$'}v0: [ID!]) { + | issuesByIds(id: ${'$'}v0) { | details { | __typename | name @@ -34,7 +34,15 @@ public class `renamed type inside batch hydration snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "issue-1", + | "issue-2", + | "issue-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename snapshot.kt index 9697a33c4..44780fb0c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename snapshot.kt @@ -24,8 +24,8 @@ public class `renamed type inside deep rename snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__deep_rename__assignee: __typename | deep_rename__assignee__details: details { | assignee { @@ -39,7 +39,11 @@ public class `renamed type inside deep rename snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename that returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename that returns null snapshot.kt index 6a0e9f7de..5eafe2e3d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename that returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside deep rename that returns null snapshot.kt @@ -24,8 +24,8 @@ public class `renamed type inside deep rename that returns null snapshot` : Test ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__deep_rename__assignee: __typename | deep_rename__assignee__details: details { | assignee { @@ -39,7 +39,11 @@ public class `renamed type inside deep rename that returns null snapshot` : Test | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration snapshot.kt index 7b438319c..1c175a6f6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration snapshot.kt @@ -24,8 +24,8 @@ public class `renamed type inside hydration snapshot` : TestSnapshot() { ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-2") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | details { | __typename | name @@ -33,7 +33,11 @@ public class `renamed type inside hydration snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-2" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration that returns null snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration that returns null snapshot.kt index 34cc1ae00..15b5e13f1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration that returns null snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/renamed type inside hydration that returns null snapshot.kt @@ -24,8 +24,8 @@ public class `renamed type inside hydration that returns null snapshot` : TestSn ExpectedServiceCall( service = "IssueService", query = """ - | { - | issueById(id: "issue-2") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | details { | __typename | name @@ -33,7 +33,11 @@ public class `renamed type inside hydration that returns null snapshot` : TestSn | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue-2" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/repeated fragments with renamed types snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/repeated fragments with renamed types snapshot.kt index 8764ac13b..5f459842d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/repeated fragments with renamed types snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/types/repeated fragments with renamed types snapshot.kt @@ -24,8 +24,8 @@ public class `repeated fragments with renamed types snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Users", query = """ - | { - | service(id: "service-1") { + | query (${'$'}v0: ID!) { + | service(id: ${'$'}v0) { | __typename | dependedOn { | __typename @@ -212,7 +212,11 @@ public class `repeated fragments with renamed types snapshot` : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "service-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/variable referenced input types rename works as expected snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/variable referenced input types rename works as expected snapshot.kt index 66834ad06..fbb238986 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/variable referenced input types rename works as expected snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/renames/variable referenced input types rename works as expected snapshot.kt @@ -24,11 +24,17 @@ public class `variable referenced input types rename works as expected snapshot` ExpectedServiceCall( service = "MyService", query = """ - | query X { - | renameInput(arg1: {inputVal : "x"}) + | query X(${'$'}v0: InputUnderlying!) { + | renameInput(arg1: ${'$'}v0) + | } + """.trimMargin(), + variables = """ + | { + | "v0": { + | "inputVal": "x" + | } | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/result merging/calls to multiple services are merged snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/result merging/calls to multiple services are merged snapshot.kt index 4a6eed44b..e6d966ae2 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/result merging/calls to multiple services are merged snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/result merging/calls to multiple services are merged snapshot.kt @@ -24,13 +24,17 @@ public class `calls to multiple services are merged snapshot` : TestSnapshot() { ExpectedServiceCall( service = "bar", query = """ - | { - | bar(id: "1") { + | query (${'$'}v0: ID!) { + | bar(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -46,13 +50,17 @@ public class `calls to multiple services are merged snapshot` : TestSnapshot() { ExpectedServiceCall( service = "foo", query = """ - | { - | foo(id: "1") { + | query (${'$'}v0: ID!) { + | foo(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -68,13 +76,17 @@ public class `calls to multiple services are merged snapshot` : TestSnapshot() { ExpectedServiceCall( service = "foo", query = """ - | { - | loot: foo(id: "1") { + | query (${'$'}v0: ID!) { + | loot: foo(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/date time scalar as input type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/date time scalar as input type snapshot.kt index 0ddf728a2..b1c71553b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/date time scalar as input type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/date time scalar as input type snapshot.kt @@ -24,13 +24,17 @@ public class `date time scalar as input type snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | foo(input: "2022-03-09T05:01:50Z") { + | query (${'$'}v0: DateTime) { + | foo(input: ${'$'}v0) { | thing | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "2022-03-09T05:01:50Z" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating json data snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating json data snapshot.kt index 742dc9ae8..68165a9e4 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating json data snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating json data snapshot.kt @@ -24,13 +24,17 @@ public class `hydrating json data snapshot` : TestSnapshot() { ExpectedServiceCall( service = "Baz", query = """ - | { - | otherFoo(id: "10000") { + | query (${'$'}v0: ID!) { + | otherFoo(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "10000" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using date time as arg snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using date time as arg snapshot.kt index f41ebbe0d..6dec117f0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using date time as arg snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using date time as arg snapshot.kt @@ -48,13 +48,17 @@ public class `hydrating using date time as arg snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | successor(after: "2022-03-09T05:01:50Z") { + | query (${'$'}v0: DateTime) { + | successor(after: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "2022-03-09T05:01:50Z" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using long as arg snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using long as arg snapshot.kt index 0b69dd200..70aed36e3 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using long as arg snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using long as arg snapshot.kt @@ -48,13 +48,17 @@ public class `hydrating using long as arg snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | successor(after: 3000000000) { + | query (${'$'}v0: Long) { + | successor(after: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 3000000000 + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using url as arg snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using url as arg snapshot.kt index f1982d32e..53181ea56 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using url as arg snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/hydrating using url as arg snapshot.kt @@ -50,15 +50,19 @@ public class `hydrating using url as arg snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | lookup(url: "https://github.com/atlassian-labs/nadel") { + | query (${'$'}v0: URL) { + | lookup(url: ${'$'}v0) { | baseUrl | createdAt | owner | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "https://github.com/atlassian-labs/nadel" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar argument with default values snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar argument with default values snapshot.kt index 4c4679418..a741065c9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar argument with default values snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar argument with default values snapshot.kt @@ -24,11 +24,15 @@ public class `long scalar argument with default values snapshot` : TestSnapshot( ExpectedServiceCall( service = "service", query = """ + | query (${'$'}v0: Long) { + | getFoo(arg: ${'$'}v0) + | } + """.trimMargin(), + variables = """ | { - | getFoo(arg: 15) + | "v0": 15 | } """.trimMargin(), - variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar as input type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar as input type snapshot.kt index 456c5b436..48df0baab 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar as input type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/long scalar as input type snapshot.kt @@ -24,13 +24,17 @@ public class `long scalar as input type snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | foo(input: 3000000000) { + | query (${'$'}v0: Long) { + | foo(input: ${'$'}v0) { | thing | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 3000000000 + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/url scalar as input type snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/url scalar as input type snapshot.kt index a675e3672..1267dc31c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/url scalar as input type snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/scalars/url scalar as input type snapshot.kt @@ -24,13 +24,17 @@ public class `url scalar as input type snapshot` : TestSnapshot() { ExpectedServiceCall( service = "service", query = """ - | { - | foo(input: "https://atlassian.com") { + | query (${'$'}v0: URL) { + | foo(input: ${'$'}v0) { | thing | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "https://atlassian.com" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive field with hydrated parent snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive field with hydrated parent snapshot.kt index db343fc14..71727b207 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive field with hydrated parent snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive field with hydrated parent snapshot.kt @@ -24,13 +24,17 @@ public class `handles include directive field with hydrated parent snapshot` : T ExpectedServiceCall( service = "service", query = """ - | { - | fooById(id: "Foo-1") { + | query (${'$'}v0: ID) { + | fooById(id: ${'$'}v0) { | __typename__skip_include____skip: __typename | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "Foo-1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive on field with batch hydrated parent snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive on field with batch hydrated parent snapshot.kt index 3deb701df..e5e0af8ed 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive on field with batch hydrated parent snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/skip-include-fields/hydration/handles include directive on field with batch hydrated parent snapshot.kt @@ -55,14 +55,21 @@ public class `handles include directive on field with batch hydrated parent snap ExpectedServiceCall( service = "service", query = """ - | { - | tests(ids: ["Foo-3", "Foo-4"]) { + | query (${'$'}v0: [ID]) { + | tests(ids: ${'$'}v0) { | __typename__skip_include____skip: __typename | batch_hydration__test__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "Foo-3", + | "Foo-4" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt b/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt index c8ed635db..748db9e35 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt @@ -12,8 +12,6 @@ import graphql.execution.instrumentation.InstrumentationState import graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters import graphql.incremental.DelayedIncrementalPartialResult import graphql.incremental.IncrementalExecutionResult -import graphql.language.AstPrinter -import graphql.language.AstSorter import graphql.nadel.Nadel import graphql.nadel.NadelExecutionHints import graphql.nadel.NadelExecutionInput @@ -24,13 +22,13 @@ import graphql.nadel.error.NadelGraphQLErrorException import graphql.nadel.instrumentation.NadelInstrumentation import graphql.nadel.instrumentation.parameters.NadelInstrumentationIsTimingEnabledParameters import graphql.nadel.tests.assertJsonObjectEquals +import graphql.nadel.tests.canonicalizeServiceRequest import graphql.nadel.tests.compareJsonObject import graphql.nadel.tests.jsonObjectMapper import graphql.nadel.tests.withPrettierPrinter import graphql.nadel.validation.NadelSchemaValidation import graphql.nadel.validation.NadelSchemaValidationError import graphql.nadel.validation.NadelSchemaValidationFactory -import graphql.parser.Parser import graphql.schema.idl.RuntimeWiring import graphql.schema.idl.SchemaGenerator import graphql.schema.idl.SchemaParser @@ -327,14 +325,6 @@ abstract class NadelIntegrationTest( } private fun assertServiceCalls(testSnapshot: TestSnapshot) { - fun getCanonicalQuery(query: String): String { - return AstPrinter.printAstCompact( - AstSorter().sort( - Parser().parseDocument(query), - ), - ) - } - fun isDelayedResultsEqual( expectedCall: ExpectedServiceCall, actualCall: TestExecutionCapture.Call, @@ -357,14 +347,23 @@ abstract class NadelIntegrationTest( expected = testSnapshot.calls, actual = executionCapture.calls ) { expectedCall, actualCall -> - val actualQuery = getCanonicalQuery(actualCall.query) - val actualVariables = actualCall.variables + val expectedRequest = canonicalizeServiceRequest( + query = expectedCall.query, + variables = expectedCall.variables, + ) + val actualRequest = canonicalizeServiceRequest( + query = actualCall.query, + variables = actualCall.variables, + ) val actualResult = actualCall.result actualCall.service == expectedCall.service && expectedCall.delayedResults.size == actualCall.delayedResults.size - && getCanonicalQuery(expectedCall.query) == actualQuery - && compareJsonObject(expected = expectedCall.variables, actual = actualVariables).passed() + && expectedRequest.query == actualRequest.query + && compareJsonObject( + expected = expectedRequest.variables, + actual = actualRequest.variables, + ).passed() && compareJsonObject(expected = expectedCall.result, actual = actualResult).passed() && isDelayedResultsEqual(expectedCall, actualCall) } diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt b/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt index 4d54a2c59..adff84f42 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt @@ -6,11 +6,9 @@ import graphql.incremental.DelayedIncrementalPartialResult import graphql.incremental.IncrementalExecutionResult import graphql.incremental.IncrementalExecutionResultImpl import graphql.nadel.NadelExecutionInput -import graphql.language.AstPrinter -import graphql.language.AstSorter import graphql.nadel.engine.util.JsonMap +import graphql.nadel.tests.canonicalizeServiceRequest import graphql.nadel.tests.jsonObjectMapper -import graphql.parser.Parser import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.reactive.asFlow import kotlinx.coroutines.reactive.asPublisher @@ -47,17 +45,16 @@ class TestExecutionCapture { ): ExecutionResult { val delayedResults = synchronizedMutableListOf() - val canonicalQuery = AstPrinter.printAst( - AstSorter().sort( - Parser().parseDocument(query) - ), + val canonicalRequest = canonicalizeServiceRequest( + query = query, + variables = variables, ) _calls.add( Call( service = service, - query = canonicalQuery, - variables = variables, + query = canonicalRequest.query, + variables = canonicalRequest.variables, result = deepClone(result), delayedResults = delayedResults, ), diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/BasicObjectSchemaTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/BasicObjectSchemaTestSnapshot.kt index c6bebcad3..7ea2ab238 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/BasicObjectSchemaTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/BasicObjectSchemaTestSnapshot.kt @@ -20,13 +20,17 @@ private suspend fun main() { ExpectedServiceCall( service = "test", query = """ - | { - | issueById(id: "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/HiddenFieldHintOnSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/HiddenFieldHintOnSnapshot.kt index 48b75e03c..f3a8c38ab 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/HiddenFieldHintOnSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/basic/HiddenFieldHintOnSnapshot.kt @@ -20,13 +20,17 @@ private suspend fun main() { ExpectedServiceCall( service = "test", query = """ - | { - | issueById(id: "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batchHydration/BatchHydrationAtQueryTypeTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batchHydration/BatchHydrationAtQueryTypeTestSnapshot.kt index f17b30ab5..f5270c908 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batchHydration/BatchHydrationAtQueryTypeTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batchHydration/BatchHydrationAtQueryTypeTestSnapshot.kt @@ -25,8 +25,8 @@ public class BatchHydrationAtQueryTypeTestSnapshot : TestSnapshot() { service = "issues", query = """ | { - | batch_hydration__myIssues__myIssueKeys: myIssueKeys | __typename__batch_hydration__myIssues: __typename + | batch_hydration__myIssues__myIssueKeys: myIssueKeys | } """.trimMargin(), variables = "{}", @@ -47,14 +47,21 @@ public class BatchHydrationAtQueryTypeTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issuesByIds(ids: ["hello", "bye"]) { - | title + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | batch_hydration__myIssues__id: id + | title | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "hello", + | "bye" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batching/BatchRootFieldsByShardTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batching/BatchRootFieldsByShardTestSnapshot.kt index 1246e1199..ec605d202 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batching/BatchRootFieldsByShardTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/batching/BatchRootFieldsByShardTestSnapshot.kt @@ -41,16 +41,21 @@ public class BatchRootFieldsByShardTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | a: issueById(cloudId: "site-1") { + | query (${'$'}v0: String!, ${'$'}v1: String!) { + | a: issueById(cloudId: ${'$'}v0) { | id | } - | b: issueById(cloudId: "site-1") { + | b: issueById(cloudId: ${'$'}v1) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site-1", + | "v1": "site-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -69,13 +74,17 @@ public class BatchRootFieldsByShardTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | c: issueById(cloudId: "site-2") { + | query (${'$'}v0: String!) { + | c: issueById(cloudId: ${'$'}v0) { | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site-2" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/execution/ServiceExecutionContextTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/execution/ServiceExecutionContextTestSnapshot.kt index 3f6c59d3b..61c314b6e 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/execution/ServiceExecutionContextTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/execution/ServiceExecutionContextTestSnapshot.kt @@ -20,13 +20,17 @@ private suspend fun main() { ExpectedServiceCall( service = "monolith", query = """ - | { - | bug: issue(id: 6) { + | query (${'$'}v0: ID!) { + | bug: issue(id: ${'$'}v0) { | title | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 6 + | } + """.trimMargin(), result = """ | { | "data": { @@ -42,13 +46,17 @@ private suspend fun main() { ExpectedServiceCall( service = "monolith", query = """ - | { - | issue(id: "9") { + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | title | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "9" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/CastHydrationLongInputToStringForMatchingTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/CastHydrationLongInputToStringForMatchingTestSnapshot.kt index 9268b605d..79539b9ff 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/CastHydrationLongInputToStringForMatchingTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/CastHydrationLongInputToStringForMatchingTestSnapshot.kt @@ -52,14 +52,22 @@ public class CastHydrationLongInputToStringForMatchingTestSnapshot : TestSnapsho ExpectedServiceCall( service = "myService", query = """ - | { - | spaces(ids: [1, 2, 10]) { + | query (${'$'}v0: [ID!]!) { + | spaces(ids: ${'$'}v0) { | id | batch_hydration__spaces__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | 1, + | 2, + | 10 + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationAtQueryTypeTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationAtQueryTypeTestSnapshot.kt index 3167d4e6e..6875614be 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationAtQueryTypeTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationAtQueryTypeTestSnapshot.kt @@ -25,8 +25,8 @@ public class HydrationAtQueryTypeTestSnapshot : TestSnapshot() { service = "issues", query = """ | { - | hydration__myIssue__myIssueKey: myIssueKey | __typename__hydration__myIssue: __typename + | hydration__myIssue__myIssueKey: myIssueKey | } """.trimMargin(), variables = "{}", @@ -44,13 +44,17 @@ public class HydrationAtQueryTypeTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issueById(id: "bye") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | title | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "bye" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationIdentifiedByRenamedFieldTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationIdentifiedByRenamedFieldTestSnapshot.kt index f1c6a72db..4f4bba37b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationIdentifiedByRenamedFieldTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationIdentifiedByRenamedFieldTestSnapshot.kt @@ -26,12 +26,12 @@ public class HydrationIdentifiedByRenamedFieldTestSnapshot : TestSnapshot() { query = """ | { | me { - | batch_hydration__friends__friendIds: friendIds | __typename__batch_hydration__friends: __typename + | batch_hydration__friends__friendIds: friendIds | } | } """.trimMargin(), - variables = " {}", + variables = "{}", result = """ | { | "data": { @@ -51,15 +51,22 @@ public class HydrationIdentifiedByRenamedFieldTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "myService", query = """ - | { - | users(ids: ["i", "2i"]) { - | name - | rename__batch_hydration__friends__id__canonicalAccountId: canonicalAccountId + | query (${'$'}v0: [ID!]!) { + | users(ids: ${'$'}v0) { | __typename__rename__batch_hydration__friends__id: __typename + | rename__batch_hydration__friends__id__canonicalAccountId: canonicalAccountId + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "i", + | "2i" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationMultipleNestedSourceArgumentsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationMultipleNestedSourceArgumentsTestSnapshot.kt index 301fc3530..2f7be8673 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationMultipleNestedSourceArgumentsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationMultipleNestedSourceArgumentsTestSnapshot.kt @@ -24,14 +24,20 @@ public class HydrationMultipleNestedSourceArgumentsTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "identity", query = """ - | { - | issueUser(issueId: "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1", siteId: "ari:cloud:platform::site/123", userId: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!, ${'$'}v1: ID!, ${'$'}v2: ID!) { + | issueUser(issueId: ${'$'}v1, siteId: ${'$'}v0, userId: ${'$'}v2) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:platform::site/123", + | "v1": "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1", + | "v2": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -48,8 +54,8 @@ public class HydrationMultipleNestedSourceArgumentsTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "issues", query = """ - | { - | issueById(id: "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { | __typename__hydration__assignee: __typename | hydration__assignee__assigneeCriteria: assigneeCriteria { | assigneeId @@ -61,7 +67,11 @@ public class HydrationMultipleNestedSourceArgumentsTestSnapshot : TestSnapshot() | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNestedObjectInputTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNestedObjectInputTestSnapshot.kt index d5923ed88..eb7e85859 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNestedObjectInputTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNestedObjectInputTestSnapshot.kt @@ -24,14 +24,29 @@ public class HydrationNestedObjectInputTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "identity", query = """ - | { - | userByFilter(filter: {filter : [{parentId : "123", subEntityTypes : ["a", "b", "c"]}]}) { + | query (${'$'}v0: UserSearchInput!) { + | userByFilter(filter: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": { + | "filter": [ + | { + | "parentId": "123", + | "subEntityTypes": [ + | "a", + | "b", + | "c" + | ] + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot.kt index 5cd7dbf26..bdc5fcddf 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot.kt @@ -24,8 +24,8 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : ExpectedServiceCall( service = "myService", query = """ - | { - | appUser(siteId: "site1", userId: "wow") { + | query (${'$'}v0: ID!, ${'$'}v1: ID!) { + | appUser(siteId: ${'$'}v0, userId: ${'$'}v1) { | __typename | ... on AppUser { | appUserId: id @@ -36,7 +36,12 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site1", + | "v1": "wow" + | } + """.trimMargin(), result = """ | { | "data": { @@ -53,8 +58,8 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : ExpectedServiceCall( service = "myService", query = """ - | { - | appUser(siteId: "site2", userId: "aoeu") { + | query (${'$'}v0: ID!, ${'$'}v1: ID!) { + | appUser(siteId: ${'$'}v0, userId: ${'$'}v1) { | __typename | ... on AppUser { | appUserId: id @@ -65,7 +70,12 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site2", + | "v1": "aoeu" + | } + """.trimMargin(), result = """ | { | "data": { @@ -82,8 +92,8 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : ExpectedServiceCall( service = "myService", query = """ - | { - | appUser(siteId: "site2", userId: "wow") { + | query (${'$'}v0: ID!, ${'$'}v1: ID!) { + | appUser(siteId: ${'$'}v0, userId: ${'$'}v1) { | __typename | ... on AppUser { | appUserId: id @@ -94,7 +104,12 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site2", + | "v1": "wow" + | } + """.trimMargin(), result = """ | { | "data": { @@ -111,8 +126,8 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : ExpectedServiceCall( service = "myService", query = """ - | { - | atlassianAccountUser(siteId: "site1", userId: "aoeu") { + | query (${'$'}v0: ID!, ${'$'}v1: ID!) { + | atlassianAccountUser(siteId: ${'$'}v0, userId: ${'$'}v1) { | __typename | ... on AtlassianAccountUser { | atlassianAccountUserId: id @@ -123,7 +138,12 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site1", + | "v1": "aoeu" + | } + """.trimMargin(), result = """ | { | "data": { @@ -140,8 +160,8 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : ExpectedServiceCall( service = "myService", query = """ - | { - | customerUser(siteId: "site2", userId: "asdf") { + | query (${'$'}v0: ID!, ${'$'}v1: ID!) { + | customerUser(siteId: ${'$'}v0, userId: ${'$'}v1) { | __typename | ... on CustomerUser { | customerUserId: id @@ -152,7 +172,12 @@ public class HydrationNonBatchedMultipleSourceArgumentsConditionalTestSnapshot : | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "site2", + | "v1": "asdf" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationRemainingArgumentsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationRemainingArgumentsTestSnapshot.kt index 930063041..3a8ef5de0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationRemainingArgumentsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationRemainingArgumentsTestSnapshot.kt @@ -19,20 +19,21 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() { override val calls: List = listOf( ExpectedServiceCall( service = "graph_store", - query = """ - | query (${'$'}v0: JSON) { - | graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?", remainingArgs: ${'$'}v0) { + query = """ + | query (${'$'}v0: String!, ${'$'}v1: JSON) { + | graphStore_query(query: ${'$'}v0, remainingArgs: ${'$'}v1) { | __typename | edges { - | batch_hydration__node__nodeId: nodeId | __typename__batch_hydration__node: __typename + | batch_hydration__node__nodeId: nodeId | } | } | } """.trimMargin(), - variables = """ + variables = """ | { - | "v0": { + | "v0": "SELECT * FROM Work WHERE teamId = ?", + | "v1": { | "orgId": "turtles", | "teamId": null | } @@ -58,16 +59,22 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() { ), ExpectedServiceCall( service = "jira", - query = """ - | { - | issuesByIds(ids: ["ari:cloud:jira::issue/1"]) { + query = """ + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | __typename - | key | batch_hydration__node__id: id + | key | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::issue/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationTestSnapshot.kt index dc83d324d..247074b01 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationTestSnapshot.kt @@ -24,14 +24,18 @@ public class HydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "identity", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -48,16 +52,20 @@ public class HydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issueById(id: "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { + | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | id | key - | hydration__assignee__assigneeId: assigneeId - | __typename__hydration__assignee: __typename | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationThrowsErrorTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationThrowsErrorTestSnapshot.kt index 319808b38..b79f27341 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationThrowsErrorTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationThrowsErrorTestSnapshot.kt @@ -24,16 +24,20 @@ public class HydrationThrowsErrorTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issueById(id: "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1") { + | query (${'$'}v0: ID!) { + | issueById(id: ${'$'}v0) { + | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | id | key - | hydration__assignee__assigneeId: assigneeId - | __typename__hydration__assignee: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": "ari:cloud:jira:19b8272f-8d25-4706-adce-8db72305e615:issue/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationUnionDuplicateDefaultHydratedTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationUnionDuplicateDefaultHydratedTestSnapshot.kt index d044f633d..78a73eba1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationUnionDuplicateDefaultHydratedTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/HydrationUnionDuplicateDefaultHydratedTestSnapshot.kt @@ -58,14 +58,22 @@ public class HydrationUnionDuplicateDefaultHydratedTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "myService", query = """ - | { - | users(ids: ["aoeu", "asdf", "wow"]) { + | query (${'$'}v0: [ID!]!) { + | users(ids: ${'$'}v0) { | __typename | batch_hydration__user__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "aoeu", + | "asdf", + | "wow" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationCommonInterfaceMigrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationCommonInterfaceMigrationTestSnapshot.kt index 27a41b436..47ca68819 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationCommonInterfaceMigrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationCommonInterfaceMigrationTestSnapshot.kt @@ -24,8 +24,8 @@ public class PolymorphicHydrationCommonInterfaceMigrationTestSnapshot : TestSnap ExpectedServiceCall( service = "monolith", query = """ - | { - | oldObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | oldObjects(ids: ${'$'}v0) { | __typename | id | batch_hydration__object__id: id @@ -33,7 +33,13 @@ public class PolymorphicHydrationCommonInterfaceMigrationTestSnapshot : TestSnap | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationMigrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationMigrationTestSnapshot.kt index 5eea67a85..dc8cad68a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationMigrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/PolymorphicHydrationMigrationTestSnapshot.kt @@ -99,14 +99,20 @@ public class PolymorphicHydrationMigrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | newObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | newObjects(ids: ${'$'}v0) { | __typename | batch_hydration__object__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -125,15 +131,21 @@ public class PolymorphicHydrationMigrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | newObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | newObjects(ids: ${'$'}v0) { | __typename | id | batch_hydration__object__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -153,15 +165,21 @@ public class PolymorphicHydrationMigrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | newObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | newObjects(ids: ${'$'}v0) { | __typename | id | batch_hydration__object__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -181,15 +199,21 @@ public class PolymorphicHydrationMigrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | newObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | newObjects(ids: ${'$'}v0) { | __typename | id | batch_hydration__object__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -259,15 +283,21 @@ public class PolymorphicHydrationMigrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | oldObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | oldObjects(ids: ${'$'}v0) { | __typename | id | batch_hydration__object__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -287,15 +317,21 @@ public class PolymorphicHydrationMigrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | oldObjects(ids: ["ari:cloud:owner::type/1"]) { + | query (${'$'}v0: [ID!]!) { + | oldObjects(ids: ${'$'}v0) { | __typename | id | batch_hydration__object__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:owner::type/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/BatchHydrationConditionalEnumConditionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/BatchHydrationConditionalEnumConditionTestSnapshot.kt index 1f681944e..0199a82e9 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/BatchHydrationConditionalEnumConditionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/BatchHydrationConditionalEnumConditionTestSnapshot.kt @@ -24,14 +24,21 @@ public class BatchHydrationConditionalEnumConditionTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "service2", query = """ - | { - | storyBarsById(ids: ["bar-id-1", "bar-id-2"]) { + | query (${'$'}v0: [ID]) { + | storyBarsById(ids: ${'$'}v0) { | batch_hydration__bars__id: id | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "bar-id-1", + | "bar-id-2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalBooleanConditionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalBooleanConditionTestSnapshot.kt index c576a33ce..fb0900a92 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalBooleanConditionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalBooleanConditionTestSnapshot.kt @@ -78,13 +78,17 @@ public class HydrationConditionalBooleanConditionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "matching-bar-id") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "matching-bar-id" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalEnumConditionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalEnumConditionTestSnapshot.kt index 288756503..e464e09bd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalEnumConditionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalEnumConditionTestSnapshot.kt @@ -24,13 +24,17 @@ public class HydrationConditionalEnumConditionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "service2", query = """ - | { - | barById(id: "matching-bar-id") { + | query (${'$'}v0: ID) { + | barById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "matching-bar-id" + | } + """.trimMargin(), result = """ | { | "data": { @@ -49,10 +53,10 @@ public class HydrationConditionalEnumConditionTestSnapshot : TestSnapshot() { | { | foo { | __typename__hydration__matchingBar: __typename - | hydration__matchingBar__matchingBarId: matchingBarId - | hydration__matchingBar__type: type | __typename__hydration__nonMatchingBar: __typename + | hydration__matchingBar__matchingBarId: matchingBarId | hydration__nonMatchingBar__nonMatchingBarId: nonMatchingBarId + | hydration__matchingBar__type: type | hydration__nonMatchingBar__type: type | } | } diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalMultipleEnumConditionsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalMultipleEnumConditionsTestSnapshot.kt index b5fd80627..78ab4524f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalMultipleEnumConditionsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/conditional/HydrationConditionalMultipleEnumConditionsTestSnapshot.kt @@ -24,13 +24,17 @@ public class HydrationConditionalMultipleEnumConditionsTestSnapshot : TestSnapsh ExpectedServiceCall( service = "service2", query = """ - | { - | storyBarById(id: "bar-id") { + | query (${'$'}v0: ID) { + | storyBarById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "bar-id" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/DeferGroupingTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/DeferGroupingTestSnapshot.kt index 3b0c4de37..286cc93be 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/DeferGroupingTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/DeferGroupingTestSnapshot.kt @@ -24,11 +24,11 @@ public class DeferGroupingTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | issue(id: 1) { + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | ... @defer { - | key | id + | key | } | ... @defer { | key @@ -36,7 +36,11 @@ public class DeferGroupingTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 1 + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferFlagOffTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferFlagOffTestSnapshot.kt index afc9d8810..f91479a0c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferFlagOffTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferFlagOffTestSnapshot.kt @@ -24,15 +24,19 @@ public class HydrationDeferFlagOffTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "ari:cloud:jira::issue/1") { - | id - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira::issue/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -50,13 +54,17 @@ public class HydrationDeferFlagOffTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | user(id: "ari:cloud:jira::user/1") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot.kt index c4249ba9c..bfb30c8f8 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot.kt @@ -24,15 +24,23 @@ public class HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot : TestSna ExpectedServiceCall( service = "issues", query = """ - | { - | issuesByKeys(keys: ["GQLGW-2", "GQLGW-3", "GQLGW-4"]) { - | key - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: [String!]!) { + | issuesByKeys(keys: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "GQLGW-2", + | "GQLGW-3", + | "GQLGW-4" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -62,13 +70,17 @@ public class HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot : TestSna ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/0") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/0" + | } + """.trimMargin(), result = """ | { | "errors": [ @@ -90,13 +102,17 @@ public class HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot : TestSna ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -112,13 +128,17 @@ public class HydrationDeferForwardsErrorsFromEachHydrationTestSnapshot : TestSna ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/10") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/10" + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsTestSnapshot.kt index 1f9a55230..9f442ed30 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferForwardsErrorsTestSnapshot.kt @@ -24,14 +24,18 @@ public class HydrationDeferForwardsErrorsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issueByKey(key: "GQLGW-2") { - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: String!) { + | issueByKey(key: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-2" + | } + """.trimMargin(), result = """ | { | "data": { @@ -48,13 +52,17 @@ public class HydrationDeferForwardsErrorsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/0") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/0" + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferGroupingTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferGroupingTestSnapshot.kt index 89b62debc..823713efd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferGroupingTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferGroupingTestSnapshot.kt @@ -24,17 +24,21 @@ public class HydrationDeferGroupingTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | issue(id: 1) { - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | ... @defer { | key | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": 1 + | } + """.trimMargin(), result = """ | { | "data": { @@ -67,13 +71,17 @@ public class HydrationDeferGroupingTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | user(id: "1") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListNestedTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListNestedTestSnapshot.kt index 455e34e81..02bcd8f25 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListNestedTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListNestedTestSnapshot.kt @@ -24,19 +24,23 @@ public class HydrationDeferInListNestedTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issueByKey(key: "GQLGW-3") { + | query (${'$'}v0: String!) { + | issueByKey(key: ${'$'}v0) { | key | related { | parent { - | hydration__assignee__assigneeId: assigneeId | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | } | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-3" + | } + """.trimMargin(), result = """ | { | "data": { @@ -63,13 +67,17 @@ public class HydrationDeferInListNestedTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTestSnapshot.kt index dc29d74f7..be315f3b5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTestSnapshot.kt @@ -24,19 +24,23 @@ public class HydrationDeferInListTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issueByKey(key: "GQLGW-2") { - | key - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: String!) { + | issueByKey(key: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | key | related { - | hydration__assignee__assigneeId: assigneeId | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-2" + | } + """.trimMargin(), result = """ | { | "data": { @@ -60,13 +64,17 @@ public class HydrationDeferInListTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -82,13 +90,17 @@ public class HydrationDeferInListTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/2") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/2" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTopLevelTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTopLevelTestSnapshot.kt index 2f0f153cb..97a17d99c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTopLevelTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTopLevelTestSnapshot.kt @@ -26,9 +26,9 @@ public class HydrationDeferInListTopLevelTestSnapshot : TestSnapshot() { query = """ | { | issues { - | key - | hydration__assignee__assigneeId: assigneeId | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | key | } | } """.trimMargin(), @@ -67,13 +67,17 @@ public class HydrationDeferInListTopLevelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -89,13 +93,17 @@ public class HydrationDeferInListTopLevelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -111,13 +119,17 @@ public class HydrationDeferInListTopLevelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/2") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/2" + | } + """.trimMargin(), result = """ | { | "data": { @@ -133,13 +145,17 @@ public class HydrationDeferInListTopLevelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/3") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/3" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTwoDimensionsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTwoDimensionsTestSnapshot.kt index 07ab0ce2c..0d97a14bc 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTwoDimensionsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInListTwoDimensionsTestSnapshot.kt @@ -26,9 +26,9 @@ public class HydrationDeferInListTwoDimensionsTestSnapshot : TestSnapshot() { query = """ | { | issueGroups { - | key - | hydration__assignee__assigneeId: assigneeId | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | key | } | } """.trimMargin(), @@ -71,13 +71,17 @@ public class HydrationDeferInListTwoDimensionsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -93,13 +97,17 @@ public class HydrationDeferInListTwoDimensionsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -115,13 +123,17 @@ public class HydrationDeferInListTwoDimensionsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/2") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/2" + | } + """.trimMargin(), result = """ | { | "data": { @@ -137,13 +149,17 @@ public class HydrationDeferInListTwoDimensionsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/3") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/3" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot.kt index ec934a0a7..339037727 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot.kt @@ -24,14 +24,18 @@ public class HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot : TestS ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueById__getIssueById: getIssueById(id: "1") { - | hydration__assigneeV2__assigneeId: assigneeId + | query (${'$'}v0: ID!) { + | rename__issueById__getIssueById: getIssueById(id: ${'$'}v0) { | __typename__hydration__assigneeV2: __typename + | hydration__assigneeV2__assigneeId: assigneeId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -48,14 +52,18 @@ public class HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot : TestS ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueById__getIssueById: getIssueById(id: "1") { - | hydration__self__id: id + | query (${'$'}v0: ID!) { + | rename__issueById__getIssueById: getIssueById(id: ${'$'}v0) { | __typename__hydration__self: __typename + | hydration__self__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -72,14 +80,18 @@ public class HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot : TestS ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueById__getIssueById: getIssueById(id: "1") { - | hydration__self__id: id + | query (${'$'}v0: ID!) { + | rename__issueById__getIssueById: getIssueById(id: ${'$'}v0) { | __typename__hydration__self: __typename + | hydration__self__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -96,15 +108,19 @@ public class HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot : TestS ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueByKey__getIssueByKey: getIssueByKey(key: "GQLGW-1") { - | key - | hydration__self__id: id + | query (${'$'}v0: String!) { + | rename__issueByKey__getIssueByKey: getIssueByKey(key: ${'$'}v0) { | __typename__hydration__self: __typename + | hydration__self__id: id + | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -122,13 +138,17 @@ public class HydrationDeferInRenamedFieldAndNestedHydrationsTestSnapshot : TestS ExpectedServiceCall( service = "users", query = """ - | { - | rename__quickUser__user_fast: user_fast(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | rename__quickUser__user_fast: user_fast(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldTestSnapshot.kt index 7c9e86d50..a7a006f96 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldTestSnapshot.kt @@ -24,15 +24,19 @@ public class HydrationDeferInRenamedFieldTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueByKey__getIssueByKey: getIssueByKey(key: "GQLGW-1") { - | key - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: String!) { + | rename__issueByKey__getIssueByKey: getIssueByKey(key: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -50,13 +54,17 @@ public class HydrationDeferInRenamedFieldTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldUsingRenamedFieldTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldUsingRenamedFieldTestSnapshot.kt index 5c3bb1005..7aaa37a02 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldUsingRenamedFieldTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInRenamedFieldUsingRenamedFieldTestSnapshot.kt @@ -24,15 +24,19 @@ public class HydrationDeferInRenamedFieldUsingRenamedFieldTestSnapshot : TestSna ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueByKey__getIssueByKey: getIssueByKey(key: "GQLGW-1") { - | key - | hydration__assigneeV2__assigneeId: assigneeId + | query (${'$'}v0: String!) { + | rename__issueByKey__getIssueByKey: getIssueByKey(key: ${'$'}v0) { | __typename__hydration__assigneeV2: __typename + | hydration__assigneeV2__assigneeId: assigneeId + | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -50,13 +54,17 @@ public class HydrationDeferInRenamedFieldUsingRenamedFieldTestSnapshot : TestSna ExpectedServiceCall( service = "users", query = """ - | { - | rename__quickUser__user_fast: user_fast(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | rename__quickUser__user_fast: user_fast(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInlineFragmentGroupingTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInlineFragmentGroupingTestSnapshot.kt index ade92f1c5..b9960eda5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInlineFragmentGroupingTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferInlineFragmentGroupingTestSnapshot.kt @@ -24,19 +24,23 @@ public class HydrationDeferInlineFragmentGroupingTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | node(id: "issue/1") { + | query (${'$'}v0: ID!) { + | node(id: ${'$'}v0) { | ... on Issue @defer { | key | } | ... on Issue { - | hydration__assignee__assigneeId: assigneeId | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "issue/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -69,13 +73,17 @@ public class HydrationDeferInlineFragmentGroupingTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "monolith", query = """ - | { - | user(id: "user/1") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferIsDisabledForNestedHydrationsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferIsDisabledForNestedHydrationsTestSnapshot.kt index b6f4cff4e..1860969ea 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferIsDisabledForNestedHydrationsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferIsDisabledForNestedHydrationsTestSnapshot.kt @@ -24,14 +24,18 @@ public class HydrationDeferIsDisabledForNestedHydrationsTestSnapshot : TestSnaps ExpectedServiceCall( service = "issues", query = """ - | { - | issueByKey(key: "GQLGW-3") { - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: String!) { + | issueByKey(key: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-3" + | } + """.trimMargin(), result = """ | { | "data": { @@ -48,15 +52,19 @@ public class HydrationDeferIsDisabledForNestedHydrationsTestSnapshot : TestSnaps ExpectedServiceCall( service = "issues", query = """ - | { - | issueByKey(key: "GQLGW-3") { + | query (${'$'}v0: String!) { + | issueByKey(key: ${'$'}v0) { + | __typename__hydration__self: __typename | key | hydration__self__key: key - | __typename__hydration__self: __typename | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-3" + | } + """.trimMargin(), result = """ | { | "data": { @@ -74,13 +82,17 @@ public class HydrationDeferIsDisabledForNestedHydrationsTestSnapshot : TestSnaps ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferLabelTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferLabelTestSnapshot.kt index caf5b804f..f0944b427 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferLabelTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferLabelTestSnapshot.kt @@ -24,15 +24,19 @@ public class HydrationDeferLabelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "ari:cloud:jira::issue/1") { - | id - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira::issue/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -50,13 +54,17 @@ public class HydrationDeferLabelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | user(id: "ari:cloud:jira::user/1") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferTestSnapshot.kt index 64c05d162..38a8e68f5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationDeferTestSnapshot.kt @@ -24,15 +24,19 @@ public class HydrationDeferTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { - | issue(id: "ari:cloud:jira::issue/1") { - | id - | hydration__assignee__assigneeId: assigneeId + | query (${'$'}v0: ID!) { + | issue(id: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira::issue/1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -50,13 +54,17 @@ public class HydrationDeferTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | user(id: "ari:cloud:jira::user/1") { + | query (${'$'}v0: ID!) { + | user(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:jira::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationRenamedFieldInDeferTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationRenamedFieldInDeferTestSnapshot.kt index de79cdd7f..17e5830c0 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationRenamedFieldInDeferTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/HydrationRenamedFieldInDeferTestSnapshot.kt @@ -24,17 +24,21 @@ public class HydrationRenamedFieldInDeferTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "issues", query = """ - | { + | query (${'$'}v0: String!) { | ... @defer { - | rename__issueByKey__getIssueByKey: getIssueByKey(key: "GQLGW-1") { - | key - | hydration__assignee__assigneeId: assigneeId + | rename__issueByKey__getIssueByKey: getIssueByKey(key: ${'$'}v0) { | __typename__hydration__assignee: __typename + | hydration__assignee__assigneeId: assigneeId + | key | } | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-1" + | } + """.trimMargin(), result = """ | { | "data": {}, @@ -64,13 +68,17 @@ public class HydrationRenamedFieldInDeferTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | userById(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | userById(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot.kt index 731073a09..afb7d1362 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot.kt @@ -24,14 +24,18 @@ public class RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot : TestSna ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueById__getIssueById: getIssueById(id: "1") { - | hydration__assigneeV2__assigneeId: assigneeId + | query (${'$'}v0: ID!) { + | rename__issueById__getIssueById: getIssueById(id: ${'$'}v0) { | __typename__hydration__assigneeV2: __typename + | hydration__assigneeV2__assigneeId: assigneeId | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -48,14 +52,18 @@ public class RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot : TestSna ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueById__getIssueById: getIssueById(id: "1") { - | hydration__self__id: id + | query (${'$'}v0: ID!) { + | rename__issueById__getIssueById: getIssueById(id: ${'$'}v0) { | __typename__hydration__self: __typename + | hydration__self__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -72,14 +80,18 @@ public class RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot : TestSna ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueById__getIssueById: getIssueById(id: "1") { - | hydration__self__id: id + | query (${'$'}v0: ID!) { + | rename__issueById__getIssueById: getIssueById(id: ${'$'}v0) { | __typename__hydration__self: __typename + | hydration__self__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -96,15 +108,19 @@ public class RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot : TestSna ExpectedServiceCall( service = "issues", query = """ - | { - | rename__issueByKey__getIssueByKey: getIssueByKey(key: "GQLGW-1") { - | key - | hydration__self__id: id + | query (${'$'}v0: String!) { + | rename__issueByKey__getIssueByKey: getIssueByKey(key: ${'$'}v0) { | __typename__hydration__self: __typename + | hydration__self__id: id + | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "GQLGW-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -122,13 +138,17 @@ public class RenamedFieldInsideNestedHydrationsInsideDeferTestSnapshot : TestSna ExpectedServiceCall( service = "users", query = """ - | { - | rename__quickUser__user_fast: user_fast(id: "ari:cloud:identity::user/1") { + | query (${'$'}v0: ID!) { + | rename__quickUser__user_fast: user_fast(id: ${'$'}v0) { | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "ari:cloud:identity::user/1" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferTestSnapshot.kt index 6bb7415ce..b86df48c1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferTestSnapshot.kt @@ -22,9 +22,9 @@ public class BatchHydrationDeferTestSnapshot : TestSnapshot() { query = """ | { | issues { - | key - | batch_hydration__assignee__assigneeId: assigneeId | __typename__batch_hydration__assignee: __typename + | batch_hydration__assignee__assigneeId: assigneeId + | key | } | } """.trimMargin(), @@ -58,14 +58,22 @@ public class BatchHydrationDeferTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | usersByIds(ids: ["fwang", "sbarker2", "freis"]) { - | name + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__assignee__id: id + | name | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "fwang", + | "sbarker2", + | "freis" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferWithLabelTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferWithLabelTestSnapshot.kt index 03362a644..80ce5b05d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferWithLabelTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/defer/batch/BatchHydrationDeferWithLabelTestSnapshot.kt @@ -26,13 +26,13 @@ public class BatchHydrationDeferWithLabelTestSnapshot : TestSnapshot() { query = """ | { | issues { - | key - | batch_hydration__assignee__assigneeId: assigneeId | __typename__batch_hydration__assignee: __typename + | batch_hydration__assignee__assigneeId: assigneeId + | key | } | } """.trimMargin(), - variables = " {}", + variables = "{}", result = """ | { | "data": { @@ -62,14 +62,22 @@ public class BatchHydrationDeferWithLabelTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users", query = """ - | { - | usersByIds(ids: ["fwang", "sbarker2", "freis"]) { - | name + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__assignee__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "fwang", + | "sbarker2", + | "freis" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/idHydration/IdHydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/idHydration/IdHydrationTestSnapshot.kt index 30e4c3552..30eca7336 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/idHydration/IdHydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/idHydration/IdHydrationTestSnapshot.kt @@ -19,15 +19,21 @@ public class IdHydrationTestSnapshot : TestSnapshot() { override val calls: List = listOf( ExpectedServiceCall( service = "Identity", - query = """ - | { - | usersByIds(ids: ["ari:cloud:identity::user/1"]) { - | name + query = """ + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__assignee__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:identity::user/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -45,15 +51,21 @@ public class IdHydrationTestSnapshot : TestSnapshot() { ), ExpectedServiceCall( service = "Identity", - query = """ - | { - | usersByIds(ids: ["ari:cloud:identity::user/128"]) { - | name + query = """ + | query (${'$'}v0: [ID!]!) { + | usersByIds(ids: ${'$'}v0) { | batch_hydration__assignee__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:identity::user/128" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -71,15 +83,15 @@ public class IdHydrationTestSnapshot : TestSnapshot() { ), ExpectedServiceCall( service = "Jira", - query = """ + query = """ | { | issues { - | batch_hydration__assignee__assigneeId: assigneeId | __typename__batch_hydration__assignee: __typename + | batch_hydration__assignee__assigneeId: assigneeId | } | } """.trimMargin(), - variables = " {}", + variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationAndPolymorphicHydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationAndPolymorphicHydrationTestSnapshot.kt index 9261e617f..e3df40943 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationAndPolymorphicHydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationAndPolymorphicHydrationTestSnapshot.kt @@ -24,15 +24,21 @@ public class StaticHydrationAndPolymorphicHydrationTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "bitbucket", query = """ - | { - | pullRequestsByIds(ids: ["ari:cloud:bitbucket::pull-request/2"]) { - | title - | patch + | query (${'$'}v0: [ID!]!) { + | pullRequestsByIds(ids: ${'$'}v0) { | batch_hydration__node__id: id + | patch + | title | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:bitbucket::pull-request/2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -52,13 +58,13 @@ public class StaticHydrationAndPolymorphicHydrationTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "graph_store", query = """ - | { - | graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?") { + | query (${'$'}v0: String!) { + | graphStore_query(query: ${'$'}v0) { | edges { - | batch_hydration__node__nodeId: nodeId - | batch_hydration__node__nodeId: nodeId | __typename__batch_hydration__node: __typename | cursor + | batch_hydration__node__nodeId: nodeId + | batch_hydration__node__nodeId: nodeId | } | pageInfo { | hasNextPage @@ -66,7 +72,11 @@ public class StaticHydrationAndPolymorphicHydrationTestSnapshot : TestSnapshot() | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": "SELECT * FROM Work WHERE teamId = ?" + | } + """.trimMargin(), result = """ | { | "data": { @@ -96,14 +106,20 @@ public class StaticHydrationAndPolymorphicHydrationTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "jira", query = """ - | { - | issuesByIds(ids: ["ari:cloud:jira::issue/1"]) { - | key + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | batch_hydration__node__id: id + | key | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::issue/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationNestedErrorTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationNestedErrorTestSnapshot.kt index 84a3df092..de6688de2 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationNestedErrorTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationNestedErrorTestSnapshot.kt @@ -24,14 +24,14 @@ public class StaticHydrationNestedErrorTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "graph_store", query = """ - | { - | graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?") { + | query (${'$'}v0: String!) { + | graphStore_query(query: ${'$'}v0) { | __typename | edges { | __typename - | batch_hydration__node__nodeId: nodeId | __typename__batch_hydration__node: __typename | cursor + | batch_hydration__node__nodeId: nodeId | } | pageInfo { | __typename @@ -40,7 +40,11 @@ public class StaticHydrationNestedErrorTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": "SELECT * FROM Work WHERE teamId = ?" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationOverlappingHydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationOverlappingHydrationTestSnapshot.kt index f35d5ce0b..b824896c5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationOverlappingHydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationOverlappingHydrationTestSnapshot.kt @@ -24,8 +24,8 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "graph_store", query = """ - | { - | graphStore_query(query: "Hello World") { + | query (${'$'}v0: String!) { + | graphStore_query(query: ${'$'}v0) { | edges { | __typename__batch_hydration__node: __typename | batch_hydration__node__nodeId: nodeId @@ -33,7 +33,11 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "Hello World" + | } + """.trimMargin(), result = """ | { | "data": { @@ -58,8 +62,8 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "graph_store", query = """ - | { - | graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?") { + | query (${'$'}v0: String!) { + | graphStore_query(query: ${'$'}v0) { | __typename | edges { | __typename @@ -75,7 +79,11 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": "SELECT * FROM Work WHERE teamId = ?" + | } + """.trimMargin(), result = """ | { | "data": { @@ -109,14 +117,20 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "jira", query = """ - | { - | comments(ids: ["ari:cloud:jira::comment/2"]) { + | query (${'$'}v0: [ID!]!) { + | comments(ids: ${'$'}v0) { | __typename | batch_hydration__node__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::comment/2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -135,14 +149,21 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "jira", query = """ - | { - | comments(ids: ["ari:cloud:jira::issue/1", "ari:cloud:jira::comment/2"]) { + | query (${'$'}v0: [ID!]!) { + | comments(ids: ${'$'}v0) { | __typename | batch_hydration__node__id: id | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::issue/1", + | "ari:cloud:jira::comment/2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -162,15 +183,21 @@ public class StaticHydrationOverlappingHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "jira", query = """ - | { - | issues(ids: ["ari:cloud:jira::issue/1"]) { + | query (${'$'}v0: [ID!]!) { + | issues(ids: ${'$'}v0) { | __typename | batch_hydration__node__id: id | key | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::issue/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTestSnapshot.kt index 4968adacf..05c2e397d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTestSnapshot.kt @@ -24,11 +24,16 @@ public class StaticHydrationScalarFieldTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "graph_store", query = """ + | query (${'$'}v0: String, ${'$'}v1: String) { + | backingField(id: ${'$'}v0, secret: ${'$'}v1) + | } + """.trimMargin(), + variables = """ | { - | backingField(id: "wow", secret: "cowabunga") + | "v0": "wow", + | "v1": "cowabunga" | } """.trimMargin(), - variables = " {}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationTestSnapshot.kt index 79113d8d1..780ef44ce 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationTestSnapshot.kt @@ -24,14 +24,14 @@ public class StaticHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "graph_store", query = """ - | { - | graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?") { + | query (${'$'}v0: String!) { + | graphStore_query(query: ${'$'}v0) { | __typename | edges { | __typename - | batch_hydration__node__nodeId: nodeId | __typename__batch_hydration__node: __typename | cursor + | batch_hydration__node__nodeId: nodeId | } | pageInfo { | __typename @@ -40,7 +40,11 @@ public class StaticHydrationTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": "SELECT * FROM Work WHERE teamId = ?" + | } + """.trimMargin(), result = """ | { | "data": { @@ -68,14 +72,20 @@ public class StaticHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "jira", query = """ - | { - | issuesByIds(ids: ["ari:cloud:jira::issue/1"]) { - | key + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | batch_hydration__node__id: id + | key | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::issue/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationVirtualTypeHintOffTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationVirtualTypeHintOffTestSnapshot.kt index 4e209773d..56a93dc0b 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationVirtualTypeHintOffTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationVirtualTypeHintOffTestSnapshot.kt @@ -24,14 +24,18 @@ public class StaticHydrationVirtualTypeHintOffTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "graph_store", query = """ - | { - | graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?") { + | query (${'$'}v0: String!) { + | graphStore_query(query: ${'$'}v0) { | __typename__type_filter__edges: __typename | __typename__type_filter__pageInfo: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": "SELECT * FROM Work WHERE teamId = ?" + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPartitionCallsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPartitionCallsTestSnapshot.kt index 16efc92aa..85e04c328 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPartitionCallsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPartitionCallsTestSnapshot.kt @@ -24,14 +24,21 @@ public class ErrorOnPartitionCallsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +61,21 @@ public class ErrorOnPartitionCallsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -84,14 +98,21 @@ public class ErrorOnPartitionCallsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ @@ -122,14 +143,21 @@ public class ErrorOnPartitionCallsTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPrimaryCallTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPrimaryCallTestSnapshot.kt index 595228453..2d90667fb 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPrimaryCallTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/ErrorOnPrimaryCallTestSnapshot.kt @@ -24,14 +24,21 @@ public class ErrorOnPrimaryCallTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "errors": [ @@ -62,14 +69,21 @@ public class ErrorOnPrimaryCallTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -92,14 +106,21 @@ public class ErrorOnPrimaryCallTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -122,14 +143,21 @@ public class ErrorOnPrimaryCallTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/HydrationFollowedByPartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/HydrationFollowedByPartitionTestSnapshot.kt index 17fea8f54..dfec65163 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/HydrationFollowedByPartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/HydrationFollowedByPartitionTestSnapshot.kt @@ -67,15 +67,22 @@ public class HydrationFollowedByPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "videos_service", query = """ - | query getViewedVideos { - | videos(ids: ["video-1:partition-A", "video-3:partition-A"]) { + | query getViewedVideos(${'$'}v0: [ID!]!) { + | videos(ids: ${'$'}v0) { | id | batch_hydration__data__id: id | title | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "video-1:partition-A", + | "video-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -100,15 +107,22 @@ public class HydrationFollowedByPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "videos_service", query = """ - | query getViewedVideos { - | videos(ids: ["video-2:partition-B", "video-4:partition-B"]) { + | query getViewedVideos(${'$'}v0: [ID!]!) { + | videos(ids: ${'$'}v0) { | id | batch_hydration__data__id: id | title | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": [ + | "video-2:partition-B", + | "video-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionTestSnapshot.kt index 2a9a54d81..2e64235f1 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionTestSnapshot.kt @@ -24,10 +24,9 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-1:partition-A", to : "thing-2:partition-A"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -35,11 +34,23 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-1:partition-A", + | "to": "thing-2:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -68,10 +79,9 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-3:partition-B", to : "thing-4:partition-B"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -79,11 +89,23 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-3:partition-B", + | "to": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -112,10 +134,9 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-5:partition-C", to : "thing-6:partition-C"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -123,11 +144,23 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-5:partition-C", + | "to": "thing-6:partition-C" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -156,10 +189,9 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-7:partition-D", to : "thing-8:partition-D"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -167,11 +199,23 @@ public class MutationPartitionTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-7:partition-D", + | "to": "thing-8:partition-D" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot.kt index 080085f48..5a57b1ad6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot.kt @@ -24,10 +24,9 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-1:partition-A", to : "thing-2:partition-A"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -35,11 +34,23 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-1:partition-A", + | "to": "thing-2:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -68,10 +79,9 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-3:partition-B", to : "thing-4:partition-B"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -79,11 +89,23 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-3:partition-B", + | "to": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -112,10 +134,9 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-5:partition-C", to : "thing-6:partition-C"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -123,11 +144,23 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-5:partition-C", + | "to": "thing-6:partition-C" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "errors": [ @@ -161,10 +194,9 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-7:partition-D", to : "thing-8:partition-D"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -172,11 +204,23 @@ public class MutationPartitionWithDataFetcherErrorInPartitionCallTestSnapshot : | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-7:partition-D", + | "to": "thing-8:partition-D" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot.kt index 85247ec62..9c21973d5 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot.kt @@ -24,10 +24,9 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-1:partition-A", to : "thing-2:partition-A"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -35,11 +34,23 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-1:partition-A", + | "to": "thing-2:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "errors": [ @@ -73,10 +84,9 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-3:partition-B", to : "thing-4:partition-B"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -84,11 +94,23 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-3:partition-B", + | "to": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -117,10 +139,9 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-5:partition-C", to : "thing-6:partition-C"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -128,11 +149,23 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-5:partition-C", + | "to": "thing-6:partition-C" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -161,10 +194,9 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-7:partition-D", to : "thing-8:partition-D"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -172,11 +204,23 @@ public class MutationPartitionWithDataFetcherErrorInPrimaryCallTestSnapshot : Te | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-7:partition-D", + | "to": "thing-8:partition-D" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithErrorsOnlyTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithErrorsOnlyTestSnapshot.kt index 31308689d..9622eb10c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithErrorsOnlyTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithErrorsOnlyTestSnapshot.kt @@ -24,10 +24,9 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-1:partition-A", to : "thing-2:partition-A"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -35,11 +34,23 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-1:partition-A", + | "to": "thing-2:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -63,10 +74,9 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-3:partition-B", to : "thing-4:partition-B"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -74,11 +84,23 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-3:partition-B", + | "to": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -102,10 +124,9 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-5:partition-C", to : "thing-6:partition-C"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -113,11 +134,23 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-5:partition-C", + | "to": "thing-6:partition-C" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "errors": [ @@ -151,10 +184,9 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-7:partition-D", to : "thing-8:partition-D"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -162,11 +194,23 @@ public class MutationPartitionWithErrorsOnlyTestSnapshot : TestSnapshot() { | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-7:partition-D", + | "to": "thing-8:partition-D" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "errors": [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPartitionCallTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPartitionCallTestSnapshot.kt index 1418fdef3..c2a4dc0a6 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPartitionCallTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPartitionCallTestSnapshot.kt @@ -24,10 +24,9 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-1:partition-A", to : "thing-2:partition-A"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -35,11 +34,23 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-1:partition-A", + | "to": "thing-2:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -68,10 +79,9 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-3:partition-B", to : "thing-4:partition-B"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -79,11 +89,23 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-3:partition-B", + | "to": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -107,10 +129,9 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-5:partition-C", to : "thing-6:partition-C"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -118,11 +139,23 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-5:partition-C", + | "to": "thing-6:partition-C" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -146,10 +179,9 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-7:partition-D", to : "thing-8:partition-D"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -157,11 +189,23 @@ public class MutationPartitionWithMutationErrorInPartitionCallTestSnapshot : Tes | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-7:partition-D", + | "to": "thing-8:partition-D" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot.kt index 7e437f409..743cacf18 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot.kt @@ -24,10 +24,9 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-1:partition-A", to : "thing-2:partition-A"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -35,11 +34,23 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-1:partition-A", + | "to": "thing-2:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -63,10 +74,9 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-3:partition-B", to : "thing-4:partition-B"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -74,11 +84,23 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-3:partition-B", + | "to": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -107,10 +129,9 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-5:partition-C", to : "thing-6:partition-C"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -118,11 +139,23 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-5:partition-C", + | "to": "thing-6:partition-C" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -151,10 +184,9 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS ExpectedServiceCall( service = "things_service", query = """ - | mutation linkABunchOfThings { + | mutation linkABunchOfThings(${'$'}v0: LinkThingsInput!) { | thingsApi { - | linkThings(linkThingsInput: {thingsLinked : [{from : "thing-7:partition-D", to : "thing-8:partition-D"}]}) { - | success + | linkThings(linkThingsInput: ${'$'}v0) { | errors { | message | } @@ -162,11 +194,23 @@ public class MutationPartitionWithMutationErrorInPrimaryCallTestSnapshot : TestS | id | name | } + | success | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsLinked": [ + | { + | "from": "thing-7:partition-D", + | "to": "thing-8:partition-D" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NamespacedPartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NamespacedPartitionTestSnapshot.kt index de715ae64..b3eaf9dcf 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NamespacedPartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NamespacedPartitionTestSnapshot.kt @@ -24,16 +24,29 @@ public class NamespacedPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: ThingsFilter) { | thingsApi { - | things(filter: {thingsIds : [{id : "thing-1:partition-A"}, {id : "thing-3:partition-A"}]}) { + | things(filter: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "id": "thing-1:partition-A" + | }, + | { + | "id": "thing-3:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -58,16 +71,29 @@ public class NamespacedPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: ThingsFilter) { | thingsApi { - | things(filter: {thingsIds : [{id : "thing-2:partition-B"}, {id : "thing-4:partition-B"}]}) { + | things(filter: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "id": "thing-2:partition-B" + | }, + | { + | "id": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NestedPartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NestedPartitionTestSnapshot.kt index 122d8b1c8..1ef5a4a28 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NestedPartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NestedPartitionTestSnapshot.kt @@ -24,14 +24,27 @@ public class NestedPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(filter: {thingsIds : [{id : "thing-1:partition-A"}, {id : "thing-3:partition-A"}]}) { + | query getPartitionedThings(${'$'}v0: ThingsFilter) { + | things(filter: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "id": "thing-1:partition-A" + | }, + | { + | "id": "thing-3:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +67,27 @@ public class NestedPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(filter: {thingsIds : [{id : "thing-2:partition-B"}, {id : "thing-4:partition-B"}]}) { + | query getPartitionedThings(${'$'}v0: ThingsFilter) { + | things(filter: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "id": "thing-2:partition-B" + | }, + | { + | "id": "thing-4:partition-B" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NoPartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NoPartitionTestSnapshot.kt index a8cc658cd..157334f4f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NoPartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/NoPartitionTestSnapshot.kt @@ -24,14 +24,27 @@ public class NoPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-2:partition-A", "thing-3:partition-A", "thing-4:partition-A", "thing-5:partition-A", "thing-6:partition-A", "thing-7:partition-A", "thing-8:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-2:partition-A", + | "thing-3:partition-A", + | "thing-4:partition-A", + | "thing-5:partition-A", + | "thing-6:partition-A", + | "thing-7:partition-A", + | "thing-8:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartialPartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartialPartitionTestSnapshot.kt index 280924eab..0fb3ae7bd 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartialPartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartialPartitionTestSnapshot.kt @@ -24,20 +24,28 @@ public class PartialPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: [ID!]!, ${'$'}v1: ID!) { | api { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | stuff(id: ${'$'}v1) { | id | name | } - | stuff(id: "Stuff-1") { + | things(ids: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ], + | "v1": "Stuff-1" + | } + """.trimMargin(), result = """ | { | "data": { @@ -66,16 +74,23 @@ public class PartialPartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: [ID!]!) { | api { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | things(ids: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByHydrationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByHydrationTestSnapshot.kt index 3c2e0ec9f..66102a860 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByHydrationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByHydrationTestSnapshot.kt @@ -24,16 +24,23 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__batch_hydration__owner: __typename | id | name | batch_hydration__owner__ownerId: ownerId - | __typename__batch_hydration__owner: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -60,16 +67,23 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__batch_hydration__owner: __typename | id | name | batch_hydration__owner__ownerId: ownerId - | __typename__batch_hydration__owner: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -96,16 +110,23 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__batch_hydration__owner: __typename | id | name | batch_hydration__owner__ownerId: ownerId - | __typename__batch_hydration__owner: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -132,16 +153,23 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__batch_hydration__owner: __typename | id | name | batch_hydration__owner__ownerId: ownerId - | __typename__batch_hydration__owner: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -168,15 +196,22 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users_service", query = """ - | query getPartitionedThings { - | users(ids: ["owner-thing-1", "owner-thing-3"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | users(ids: ${'$'}v0) { | id - | name | batch_hydration__owner__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "owner-thing-1", + | "owner-thing-3" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -201,15 +236,22 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users_service", query = """ - | query getPartitionedThings { - | users(ids: ["owner-thing-2", "owner-thing-4"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | users(ids: ${'$'}v0) { | id - | name | batch_hydration__owner__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "owner-thing-2", + | "owner-thing-4" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -234,15 +276,22 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users_service", query = """ - | query getPartitionedThings { - | users(ids: ["owner-thing-5", "owner-thing-7"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | users(ids: ${'$'}v0) { | id - | name | batch_hydration__owner__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "owner-thing-5", + | "owner-thing-7" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -267,15 +316,22 @@ public class PartitionFollowedByHydrationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "users_service", query = """ - | query getPartitionedThings { - | users(ids: ["owner-thing-6", "owner-thing-8"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | users(ids: ${'$'}v0) { | id - | name | batch_hydration__owner__id: id + | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "owner-thing-6", + | "owner-thing-8" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByRenamedTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByRenamedTestSnapshot.kt index 1f7324bcf..49710c494 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByRenamedTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionFollowedByRenamedTestSnapshot.kt @@ -24,15 +24,22 @@ public class PartitionFollowedByRenamedTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__rename__name: __typename | id | rename__name__underlyingName: underlyingName - | __typename__rename__name: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -57,15 +64,22 @@ public class PartitionFollowedByRenamedTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__rename__name: __typename | id | rename__name__underlyingName: underlyingName - | __typename__rename__name: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -90,15 +104,22 @@ public class PartitionFollowedByRenamedTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__rename__name: __typename | id | rename__name__underlyingName: underlyingName - | __typename__rename__name: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -123,15 +144,22 @@ public class PartitionFollowedByRenamedTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { + | __typename__rename__name: __typename | id | rename__name__underlyingName: underlyingName - | __typename__rename__name: __typename | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionTypeWithMultipleRoutingFieldsTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionTypeWithMultipleRoutingFieldsTestSnapshot.kt index c3375ac93..a9c11ac9d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionTypeWithMultipleRoutingFieldsTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionTypeWithMultipleRoutingFieldsTestSnapshot.kt @@ -24,14 +24,29 @@ public class PartitionTypeWithMultipleRoutingFieldsTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(filter: {thingsIds : [{primaryId : "thing-1-primary:partition-A", secondaryId : "thing-1-secondary"}, {primaryId : "thing-3-primary-no-partition", secondaryId : "thing-3-secondary:partition-A"}]}) { + | query getPartitionedThings(${'$'}v0: ThingsFilter) { + | things(filter: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "primaryId": "thing-1-primary:partition-A", + | "secondaryId": "thing-1-secondary" + | }, + | { + | "primaryId": "thing-3-primary-no-partition", + | "secondaryId": "thing-3-secondary:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +69,29 @@ public class PartitionTypeWithMultipleRoutingFieldsTestSnapshot : TestSnapshot() ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(filter: {thingsIds : [{primaryId : "thing-2-same-partition:partition-B", secondaryId : "thing-2-secondary-same-partition:partition-B"}, {primaryId : "thing-4-primary:partition-B", secondaryId : "thing-4-secondary"}]}) { + | query getPartitionedThings(${'$'}v0: ThingsFilter) { + | things(filter: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "primaryId": "thing-2-same-partition:partition-B", + | "secondaryId": "thing-2-secondary-same-partition:partition-B" + | }, + | { + | "primaryId": "thing-4-primary:partition-B", + | "secondaryId": "thing-4-secondary" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithConflictingRoutingValuesThatAreFilteredTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithConflictingRoutingValuesThatAreFilteredTestSnapshot.kt index 3ca9a6ae6..cfa67049a 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithConflictingRoutingValuesThatAreFilteredTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithConflictingRoutingValuesThatAreFilteredTestSnapshot.kt @@ -24,20 +24,35 @@ public class PartitionWithConflictingRoutingValuesThatAreFilteredTestSnapshot : ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedConnections { - | things(filter: {thingsIds : [{to : "thing-1-primary:partition-A", from : "thing-1-secondary:partition-B"}, {to : "thing-4-secondary:partition-B", from : "thing-4-primary:partition-A"}]}) { - | to { + | query getPartitionedConnections(${'$'}v0: ThingsFilter) { + | things(filter: ${'$'}v0) { + | from { | id | name | } - | from { + | to { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "to": "thing-1-primary:partition-A", + | "from": "thing-1-secondary:partition-B" + | }, + | { + | "to": "thing-4-secondary:partition-B", + | "from": "thing-4-primary:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { @@ -72,20 +87,35 @@ public class PartitionWithConflictingRoutingValuesThatAreFilteredTestSnapshot : ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedConnections { - | things(filter: {thingsIds : [{to : "thing-2-secondary:partition-A", from : "thing-2-primary:partition-B"}, {to : "thing-3-primary:partition-B", from : "thing-3-secondary:partition-A"}]}) { - | to { + | query getPartitionedConnections(${'$'}v0: ThingsFilter) { + | things(filter: ${'$'}v0) { + | from { | id | name | } - | from { + | to { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": { + | "thingsIds": [ + | { + | "to": "thing-2-secondary:partition-A", + | "from": "thing-2-primary:partition-B" + | }, + | { + | "to": "thing-3-primary:partition-B", + | "from": "thing-3-secondary:partition-A" + | } + | ] + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithFieldAliasTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithFieldAliasTestSnapshot.kt index dac56683c..8b25bb835 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithFieldAliasTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithFieldAliasTestSnapshot.kt @@ -24,14 +24,21 @@ public class PartitionWithFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | aliasedThings: things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | aliasedThings: things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +61,21 @@ public class PartitionWithFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | aliasedThings: things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | aliasedThings: things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -84,14 +98,21 @@ public class PartitionWithFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | aliasedThings: things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | aliasedThings: things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -114,14 +135,21 @@ public class PartitionWithFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | aliasedThings: things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | aliasedThings: things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithNamespaceFieldAliasTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithNamespaceFieldAliasTestSnapshot.kt index c2e482961..535ccc46c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithNamespaceFieldAliasTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithNamespaceFieldAliasTestSnapshot.kt @@ -24,16 +24,23 @@ public class PartitionWithNamespaceFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: [ID!]!) { | aliasedNamespace: namespace { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | things(ids: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -58,16 +65,23 @@ public class PartitionWithNamespaceFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: [ID!]!) { | aliasedNamespace: namespace { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | things(ids: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -92,16 +106,23 @@ public class PartitionWithNamespaceFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: [ID!]!) { | aliasedNamespace: namespace { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | things(ids: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -126,16 +147,23 @@ public class PartitionWithNamespaceFieldAliasTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { + | query getPartitionedThings(${'$'}v0: [ID!]!) { | aliasedNamespace: namespace { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | things(ids: ${'$'}v0) { | id | name | } | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithSkipIncludeTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithSkipIncludeTestSnapshot.kt index 115526d0f..dd0966187 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithSkipIncludeTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithSkipIncludeTestSnapshot.kt @@ -24,13 +24,20 @@ public class PartitionWithSkipIncludeTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | age | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -51,13 +58,20 @@ public class PartitionWithSkipIncludeTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | age | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -78,13 +92,20 @@ public class PartitionWithSkipIncludeTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | age | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -105,13 +126,20 @@ public class PartitionWithSkipIncludeTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | age | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithTypeNameTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithTypeNameTestSnapshot.kt index e6d52f5cb..df6784c3c 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithTypeNameTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithTypeNameTestSnapshot.kt @@ -24,15 +24,22 @@ public class PartitionWithTypeNameTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | __typename | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -57,15 +64,22 @@ public class PartitionWithTypeNameTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | __typename | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -90,15 +104,22 @@ public class PartitionWithTypeNameTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | __typename | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -123,15 +144,22 @@ public class PartitionWithTypeNameTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | __typename | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithVariablesTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithVariablesTestSnapshot.kt index 9a413a672..1cd8f386d 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithVariablesTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/PartitionWithVariablesTestSnapshot.kt @@ -24,14 +24,21 @@ public class PartitionWithVariablesTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +61,21 @@ public class PartitionWithVariablesTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -84,14 +98,21 @@ public class PartitionWithVariablesTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -114,14 +135,21 @@ public class PartitionWithVariablesTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/SimplePartitionTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/SimplePartitionTestSnapshot.kt index d54303a8a..4abde9180 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/SimplePartitionTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/partition/SimplePartitionTestSnapshot.kt @@ -24,14 +24,21 @@ public class SimplePartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-1:partition-A", "thing-3:partition-A"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-1:partition-A", + | "thing-3:partition-A" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -54,14 +61,21 @@ public class SimplePartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-2:partition-B", "thing-4:partition-B"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-2:partition-B", + | "thing-4:partition-B" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -84,14 +98,21 @@ public class SimplePartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-5:partition-C", "thing-7:partition-C"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-5:partition-C", + | "thing-7:partition-C" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -114,14 +135,21 @@ public class SimplePartitionTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "things_service", query = """ - | query getPartitionedThings { - | things(ids: ["thing-6:partition-D", "thing-8:partition-D"]) { + | query getPartitionedThings(${'$'}v0: [ID!]!) { + | things(ids: ${'$'}v0) { | id | name | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "thing-6:partition-D", + | "thing-8:partition-D" + | ] + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedInputTypeTest.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedInputTypeTest.kt index 23fcc9a9b..4ad4b73d7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedInputTypeTest.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedInputTypeTest.kt @@ -1,6 +1,5 @@ package graphql.nadel.tests.next.fixtures.rename -import graphql.nadel.NadelExecutionHints import graphql.nadel.tests.next.NadelIntegrationTest /** @@ -72,12 +71,4 @@ class RenamedInputTypeTest : NadelIntegrationTest( }, ), ), -) { - override fun makeExecutionHints(): NadelExecutionHints.Builder { - return super.makeExecutionHints() - // todo: this should be on by default - .allDocumentVariablesHint { - true - } - } -} +) diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedScalarInputTypeTest.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedScalarInputTypeTest.kt index 28233bceb..e4c8aaa9f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedScalarInputTypeTest.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedScalarInputTypeTest.kt @@ -1,6 +1,5 @@ package graphql.nadel.tests.next.fixtures.rename -import graphql.nadel.NadelExecutionHints import graphql.nadel.NadelSchemas import graphql.nadel.tests.GatewaySchemaWiringFactory import graphql.nadel.tests.next.NadelIntegrationTest @@ -79,11 +78,6 @@ class RenamedScalarInputTypeTest : NadelIntegrationTest( ), ), ) { - override fun makeExecutionHints(): NadelExecutionHints.Builder { - return super.makeExecutionHints() - .allDocumentVariablesHint { true } - } - override fun makeNadelSchemas(): NadelSchemas.Builder { return super.makeNadelSchemas() .overallWiringFactory(GatewaySchemaWiringFactory()) diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedSharedInputTypeTest.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedSharedInputTypeTest.kt index b1db15f1b..e30c43e93 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedSharedInputTypeTest.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/rename/RenamedSharedInputTypeTest.kt @@ -1,6 +1,5 @@ package graphql.nadel.tests.next.fixtures.rename -import graphql.nadel.NadelExecutionHints import graphql.nadel.tests.next.NadelIntegrationTest /** @@ -122,12 +121,4 @@ class RenamedSharedInputTypeTest : NadelIntegrationTest( }, ), ), -) { - override fun makeExecutionHints(): NadelExecutionHints.Builder { - return super.makeExecutionHints() - // todo: this should be on by default - .allDocumentVariablesHint { - true - } - } -} +) diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/schema/CustomHydrationDirectiveTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/schema/CustomHydrationDirectiveTestSnapshot.kt index bd5bbc443..0554c1997 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/schema/CustomHydrationDirectiveTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/schema/CustomHydrationDirectiveTestSnapshot.kt @@ -23,16 +23,22 @@ public class CustomHydrationDirectiveTestSnapshot : TestSnapshot() { override val calls: List = listOf( ExpectedServiceCall( service = "bitbucket", - query = """ - | { - | pullRequestsByIds(ids: ["ari:cloud:bitbucket::pull-request/2"]) { - | title - | patch + query = """ + | query (${'$'}v0: [ID!]!) { + | pullRequestsByIds(ids: ${'$'}v0) { | batch_hydration__node__id: id + | patch + | title | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:bitbucket::pull-request/2" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -51,14 +57,14 @@ public class CustomHydrationDirectiveTestSnapshot : TestSnapshot() { ), ExpectedServiceCall( service = "graph_store", - query = """ - | query (${'$'}v0: JSON) { - | graphStore_query(other: ${'$'}v0, query: "DROP TABLE", after: "2012", first: 10) { + query = """ + | query (${'$'}v0: String!, ${'$'}v1: Int, ${'$'}v2: String, ${'$'}v3: JSON) { + | graphStore_query(after: ${'$'}v2, first: ${'$'}v1, other: ${'$'}v3, query: ${'$'}v0) { | edges { - | batch_hydration__node__nodeId: nodeId - | batch_hydration__node__nodeId: nodeId | __typename__batch_hydration__node: __typename | cursor + | batch_hydration__node__nodeId: nodeId + | batch_hydration__node__nodeId: nodeId | } | pageInfo { | hasNextPage @@ -66,9 +72,12 @@ public class CustomHydrationDirectiveTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = """ + variables = """ | { - | "v0": { + | "v0": "DROP TABLE", + | "v1": 10, + | "v2": "2012", + | "v3": { | "teamId": "hello" | } | } @@ -101,15 +110,21 @@ public class CustomHydrationDirectiveTestSnapshot : TestSnapshot() { ), ExpectedServiceCall( service = "jira", - query = """ - | { - | issuesByIds(ids: ["ari:cloud:jira::issue/1"]) { - | key + query = """ + | query (${'$'}v0: [ID!]!) { + | issuesByIds(ids: ${'$'}v0) { | batch_hydration__node__id: id + | key | } | } """.trimMargin(), - variables = " {}", + variables = """ + | { + | "v0": [ + | "ari:cloud:jira::issue/1" + | ] + | } + """.trimMargin(), result = """ | { | "data": { @@ -127,12 +142,12 @@ public class CustomHydrationDirectiveTestSnapshot : TestSnapshot() { ), ExpectedServiceCall( service = "work", - query = """ + query = """ | { | __typename__hydration__businessReport_findRecentWorkByTeam: __typename | } """.trimMargin(), - variables = " {}", + variables = "{}", result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationOperationTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationOperationTestSnapshot.kt index bef869a30..a663d1405 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationOperationTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationOperationTestSnapshot.kt @@ -24,8 +24,8 @@ public class StubFieldInMutationOperationTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "myService", query = """ - | mutation { - | createLlmBackedIssue(input: {prompt : "Need tests for stubbed fields in Mutation context"}) { + | mutation (${'$'}v0: CreateLlmBackedIssueInput) { + | createLlmBackedIssue(input: ${'$'}v0) { | issue { | __typename__stubbed__key: __typename | id @@ -35,7 +35,13 @@ public class StubFieldInMutationOperationTestSnapshot : TestSnapshot() { | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": { + | "prompt": "Need tests for stubbed fields in Mutation context" + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationPayloadTestSnapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationPayloadTestSnapshot.kt index 8b5afed21..a84ac3f07 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationPayloadTestSnapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/stub/StubFieldInMutationPayloadTestSnapshot.kt @@ -24,14 +24,20 @@ public class StubFieldInMutationPayloadTestSnapshot : TestSnapshot() { ExpectedServiceCall( service = "myService", query = """ - | mutation { - | createLlmBackedIssue(input: {prompt : "Need tests for stubbed fields in Mutation context"}) { + | mutation (${'$'}v0: CreateLlmBackedIssueInput) { + | createLlmBackedIssue(input: ${'$'}v0) { | __typename__stubbed__issue: __typename | success | } | } """.trimMargin(), - variables = "{}", + variables = """ + | { + | "v0": { + | "prompt": "Need tests for stubbed fields in Mutation context" + | } + | } + """.trimMargin(), result = """ | { | "data": { diff --git a/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml b/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml index 43b4c6e80..53b6713ee 100644 --- a/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml +++ b/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml @@ -30,10 +30,10 @@ serviceCalls: request: # language=GraphQL query: | - query myQuery { - hello(arg: {}) + query myQuery($v0: Arg) { + hello(arg: $v0) } - variables: { } + variables: {"v0":{}} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml b/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml index d70ff4b7c..8de0b5208 100644 --- a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml +++ b/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml @@ -32,13 +32,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - rename__issue__issueById: issueById(id: "57") { + query ($v0: ID) { + rename__issue__issueById: issueById(id: $v0) { __typename__rename__key: __typename rename__key__id: id } } - variables: { } + variables: {"v0":"57"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml b/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml index 02de02a1e..a15e87f86 100644 --- a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml +++ b/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml @@ -32,13 +32,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "57") { + query ($v0: ID) { + issue(id: $v0) { __typename__rename__key: __typename rename__key__id: id } } - variables: { } + variables: {"v0":"57"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml index cfe707bc5..ce35222cc 100644 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml +++ b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml @@ -62,13 +62,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { users { __typename__batch_hydration__issue: __typename batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -94,8 +94,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issuesByIds(id: ["issue-1", "issue-2", "issue-3"]) { + query ($v0: [ID!]) { + issuesByIds(id: $v0) { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { detailName @@ -103,7 +103,7 @@ serviceCalls: batch_hydration__issue__id: id } } - variables: { } + variables: {"v0":["issue-1","issue-2","issue-3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml index 0998d6775..2bbcace98 100644 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml +++ b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml @@ -62,13 +62,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { users { __typename__batch_hydration__issue: __typename batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -94,8 +94,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issuesByIds(id: ["issue-1", "issue-2", "issue-3"]) { + query ($v0: [ID!]) { + issuesByIds(id: $v0) { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { detailName @@ -103,7 +103,7 @@ serviceCalls: batch_hydration__issue__id: id } } - variables: { } + variables: {"v0":["issue-1","issue-2","issue-3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml index 8a51d1e17..9896e98b5 100644 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml +++ b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { me { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -81,15 +81,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-1") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { detailName } } } - variables: { } + variables: {"v0":"issue-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml index 0d357b50d..1414b99c0 100644 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml +++ b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { users { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,15 +91,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-1") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { detailName } } } - variables: { } + variables: {"v0":"issue-1"} # language=JSON response: |- { @@ -117,15 +117,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-2") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { detailName } } } - variables: { } + variables: {"v0":"issue-2"} # language=JSON response: |- { @@ -143,15 +143,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-3") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { detailName } } } - variables: { } + variables: {"v0":"issue-3"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml index 1de47820b..0544d907e 100644 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml +++ b/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml @@ -36,15 +36,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID!) { issue { __typename__deep_rename__name: __typename deep_rename__name__detail: detail { - detailName(userId: "USER-01") + detailName(userId: $v0) } } } - variables: { } + variables: {"v0":"USER-01"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml index 7a05be1d1..558897c09 100644 --- a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml +++ b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml @@ -57,16 +57,7 @@ serviceCalls: query myQuery($v0: UnderlyingInputArgType) { hello(arg: $v0) } - variables: - v0: - age: 50 - inputWithJson: - names: - - "Bobba" - - "Fett" - payload: - name: "Bobert" - age: "23" + variables: {"v0":{"age":50,"inputWithJson":{"names":["Bobba","Fett"],"payload":{"name":"Bobert","age":"23"}}}} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml index 2b950deb8..ea9eaff0c 100644 --- a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml +++ b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml @@ -69,16 +69,7 @@ serviceCalls: value } } - variables: - v0: - - age: 50 - inputWithJson: - - names: - - "Bobba" - - "Fett" - payload: - name: "Bobert" - age: "23" + variables: {"v0":[{"age":50,"inputWithJson":[{"names":["Bobba","Fett"],"payload":{"name":"Bobert","age":"23"}}]}]} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml index d824358a1..1625a6f7d 100644 --- a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml +++ b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml @@ -69,16 +69,7 @@ serviceCalls: value } } - variables: - v0: - age: 50 - inputWithJson: - names: - - "Bobba" - - "Fett" - payload: - name: "Bobert" - age: "23" + variables: {"v0":{"age":50,"inputWithJson":{"names":["Bobba","Fett"],"payload":{"name":"Bobert","age":"23"}}}} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml b/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml index ee2805e61..022e5124c 100644 --- a/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml +++ b/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml @@ -34,17 +34,10 @@ serviceCalls: request: # language=GraphQL query: | - query myQuery($v0: JSON, $v1: JSON!) { - hello(arg: {payload: $v0}, arg1: $v1) + query myQuery($v0: InputWithJson, $v1: JSON!) { + hello(arg: $v0, arg1: $v1) } - variables: - v0: - name: "Bobert" - age: "23" - v1: - interests: - - "photography" - - "basketball" + variables: {"v0":{"payload":{"name":"Bobert","age":"23"}},"v1":{"interests":["photography","basketball"]}} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml b/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml index aacd568d1..13e81b792 100644 --- a/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml +++ b/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml @@ -36,12 +36,10 @@ serviceCalls: request: # language=GraphQL query: | - query myQuery($v0: JSON) { - hello(arg: {payload: $v0}) + query myQuery($v0: InputWithJson) { + hello(arg: $v0) } - variables: - v0: - 48x48: "file.jpeg" + variables: {"v0":{"payload":{"48x48":"file.jpeg"}}} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml b/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml index ed7eca19d..c2a7724c8 100644 --- a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml +++ b/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml @@ -36,12 +36,10 @@ serviceCalls: request: # language=GraphQL query: | - query myQuery($v0: JSON, $v1: JSON!) { - hello(arg: {payload: $v0}, arg1: $v1) + query myQuery($v0: InputWithJson, $v1: JSON!) { + hello(arg: $v0, arg1: $v1) } - variables: - v0: "String JSON input" - v1: false + variables: {"v0":{"payload":"String JSON input"},"v1":false} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml b/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml index 24c8576e4..4765d56a9 100644 --- a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml +++ b/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml @@ -34,12 +34,10 @@ serviceCalls: request: # language=GraphQL query: | - query myQuery($v0: JSON, $v1: JSON!) { - hello(arg: {payload: $v0}, arg1: $v1) + query myQuery($v0: InputWithJson, $v1: JSON!) { + hello(arg: $v0, arg1: $v1) } - variables: - v0: "String JSON input" - v1: false + variables: {"v0":{"payload":"String JSON input"},"v1":false} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml index 58fe2bd08..88481859b 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml @@ -95,8 +95,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "pull-request:id-123") { + query ($v0: ID!) { + node(id: $v0) { id ... on PullRequest { author { @@ -107,7 +107,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"pull-request:id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml index b5e5088b0..2e73ba030 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml @@ -76,8 +76,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "pull-request:id-123") { + query ($v0: ID!) { + node(id: $v0) { __typename__type_filter__issueKey: __typename id ... on PullRequest { @@ -85,7 +85,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"pull-request:id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml index ec7b93e7d..82888ed58 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml @@ -76,15 +76,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue: node(id: "issue/id-123") { + query ($v0: ID!) { + issue: node(id: $v0) { id ... on Issue { issueKey } } } - variables: { } + variables: {"v0":"issue/id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml index b2fb1fcb2..250d01ee2 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml @@ -76,15 +76,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - pr: node(id: "pull-request:id-123") { + query ($v0: ID!) { + pr: node(id: $v0) { id ... on PullRequest { description } } } - variables: { } + variables: {"v0":"pull-request:id-123"} # language=JSON response: |- { @@ -99,15 +99,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue: node(id: "issue/id-123") { + query ($v0: ID!) { + issue: node(id: $v0) { id ... on Issue { issueKey } } } - variables: { } + variables: {"v0":"issue/id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml index cc06a20fc..af94ab8e9 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml @@ -52,15 +52,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "pull-request:id-123") { + query ($v0: ID!) { + node(id: $v0) { id ... on PullRequest { description } } } - variables: { } + variables: {"v0":"pull-request:id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml index 2cd288c01..12458a248 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml @@ -67,12 +67,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "pull-request:id-123") { + query ($v0: ID!) { + node(id: $v0) { id } } - variables: { } + variables: {"v0":"pull-request:id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml b/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml index ff9222b44..51077c120 100644 --- a/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml +++ b/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml @@ -53,8 +53,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "pull-request:id-123") { + query ($v0: ID!) { + node(id: $v0) { __typename id ... on PullRequest { @@ -62,7 +62,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"pull-request:id-123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml b/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml index 7dc6c1f9e..f1973dae8 100644 --- a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml +++ b/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml @@ -127,15 +127,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { lookUpQuery { - lookup(id: "rootId") { + lookup(id: $v0) { id name } } } - variables: { } + variables: {"v0":"rootId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml b/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml index 6886aa413..2a96e4041 100644 --- a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml +++ b/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml @@ -120,13 +120,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - lookup(id: "rootId") { + query ($v0: ID) { + lookup(id: $v0) { id name } } - variables: { } + variables: {"v0":"rootId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml index f92f8dacb..f688d2899 100644 --- a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml +++ b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml @@ -135,15 +135,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - association(filter: {name: "value"}, id: "ISSUE-1") { + query ($v0: ID, $v1: Filter) { + association(filter: $v1, id: $v0) { nodes { __typename__hydration__page: __typename hydration__page__pageId: pageId } } } - variables: { } + variables: {"v0":"ISSUE-1","v1":{"name":"value"}} # language=JSON response: |- { @@ -163,14 +163,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { pages { - page(id: "1") { + page(id: $v0) { id } } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml index 0717f0ba5..fbd6339d5 100644 --- a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml +++ b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml @@ -88,12 +88,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - association(filter: {name: "value"}, id: "ISSUE-1") { + query ($v0: ID, $v1: Filter) { + association(filter: $v1, id: $v0) { nameOfAssociation } } - variables: { } + variables: {"v0":"ISSUE-1","v1":{"name":"value"}} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml index 8a0acff00..18582c642 100644 --- a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml +++ b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml @@ -91,12 +91,12 @@ serviceCalls: request: # language=GraphQL query: | - query MyQuery { - association(filter: {name: "value"}, id: "ISSUE-1") { + query MyQuery($v0: ID, $v1: Filter) { + association(filter: $v1, id: $v0) { nameOfAssociation } } - variables: { } + variables: {"v0":"ISSUE-1","v1":{"name":"value"}} operationName: "MyQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml b/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml index 398643e7a..220545fc4 100644 --- a/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml +++ b/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml @@ -68,14 +68,14 @@ serviceCalls: request: # language=GraphQL query: | - { - issueById(id: "C1") { + query ($v0: ID) { + issueById(id: $v0) { __typename__hydration__comment: __typename hydration__comment__commentId: commentId id } } - variables: { } + variables: {"v0":"C1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml b/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml index cb19124ee..edf73766f 100644 --- a/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml +++ b/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml @@ -57,14 +57,14 @@ serviceCalls: request: # language=GraphQL query: | - { - issueById(id: "C1") { + query ($v0: ID) { + issueById(id: $v0) { __typename__hydration__comment: __typename hydration__comment__commentId: commentId id } } - variables: { } + variables: {"v0":"C1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml b/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml index 8d52776fc..a444e1238 100644 --- a/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml +++ b/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml @@ -64,14 +64,14 @@ serviceCalls: request: # language=GraphQL query: | - { - issueById(id: "C1") { + query ($v0: ID) { + issueById(id: $v0) { __typename__hydration__comment: __typename hydration__comment__commentId: commentId id } } - variables: { } + variables: {"v0":"C1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml b/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml index c8bbcf0ab..c95ef09b6 100644 --- a/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml +++ b/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml @@ -32,12 +32,12 @@ serviceCalls: request: # language=GraphQL query: | - { - rename__commentById__commentByIdUnderlying: commentByIdUnderlying(id: "C1") { + query ($v0: ID) { + rename__commentById__commentByIdUnderlying: commentByIdUnderlying(id: $v0) { id } } - variables: { } + variables: {"v0":"C1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml b/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml index bb292af87..7d463e6b1 100644 --- a/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml +++ b/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml @@ -34,12 +34,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - hello(arg: "x") { + query ($v0: String) { + hello(arg: $v0) { name } } - variables: { } + variables: {"v0":"x"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/introspection/introspection-with-variables-ff-on.yml b/test/src/test/resources/fixtures/introspection/introspection-with-variables.yml similarity index 96% rename from test/src/test/resources/fixtures/introspection/introspection-with-variables-ff-on.yml rename to test/src/test/resources/fixtures/introspection/introspection-with-variables.yml index d207bcc48..31875dd70 100644 --- a/test/src/test/resources/fixtures/introspection/introspection-with-variables-ff-on.yml +++ b/test/src/test/resources/fixtures/introspection/introspection-with-variables.yml @@ -1,4 +1,4 @@ -name: "introspection with variables FF on" +name: "introspection with variables" enabled: true # language=GraphQL overallSchema: diff --git a/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml b/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml index 0df1ffecc..5de6a92c3 100644 --- a/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml +++ b/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml @@ -32,13 +32,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "57") { + query ($v0: ID) { + issue(id: $v0) { __typename__rename__key: __typename rename__key__id: id } } - variables: { } + variables: {"v0":"57"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml b/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml index 0b2957da9..f0c9e04c9 100644 --- a/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml +++ b/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml @@ -49,7 +49,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { bar { __typename__hydration__nestedBar: __typename barId @@ -57,7 +57,7 @@ serviceCalls: name } } - variables: { } + variables: {} # language=JSON response: |- { @@ -75,14 +75,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "1") { + query ($v0: ID) { + barById(id: $v0) { __typename__hydration__nestedBar: __typename hydration__nestedBar__barId: barId barId } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { @@ -99,12 +99,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "1") { + query ($v0: ID) { + barById(id: $v0) { barId } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml index 306e78b66..aadd713cd 100644 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml @@ -89,7 +89,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -121,13 +121,13 @@ serviceCalls: request: # language=GraphQL query: | - { - usersByIds(ids: ["user-100", "user-20"]) { + query ($v0: [ID!]!) { + usersByIds(ids: $v0) { batch_hydration__user__id: id name } } - variables: { } + variables: {"v0":["user-100","user-20"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml index ee392098a..bdc88a611 100644 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml @@ -88,7 +88,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -120,12 +120,12 @@ serviceCalls: request: # language=GraphQL query: | - { - userById(id: "user-100") { + query ($v0: ID!) { + userById(id: $v0) { name } } - variables: { } + variables: {"v0":"user-100"} # language=JSON response: |- { @@ -140,12 +140,12 @@ serviceCalls: request: # language=GraphQL query: | - { - userById(id: "user-20") { + query ($v0: ID!) { + userById(id: $v0) { name } } - variables: { } + variables: {"v0":"user-20"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml index 14ec965de..daf964a61 100644 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml @@ -89,7 +89,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -121,13 +121,13 @@ serviceCalls: request: # language=GraphQL query: | - { - usersByIds(ids: ["user-100", "user-20"]) { + query ($v0: [ID!]!) { + usersByIds(ids: $v0) { batch_hydration__user__id: id name } } - variables: { } + variables: {"v0":["user-100","user-20"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml index e9e8e949d..edd59c943 100644 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml @@ -77,18 +77,18 @@ serviceCalls: query: | { activity { - ... on SomethingLame { - __typename__hydration__user: __typename - hydration__user__userId: userId - } ... on SingleActivity { user { name } } + ... on SomethingLame { + __typename__hydration__user: __typename + hydration__user__userId: userId + } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -120,12 +120,12 @@ serviceCalls: request: # language=GraphQL query: | - { - userById(id: "user-100") { + query ($v0: ID!) { + userById(id: $v0) { name } } - variables: { } + variables: {"v0":"user-100"} # language=JSON response: |- { @@ -140,12 +140,12 @@ serviceCalls: request: # language=GraphQL query: | - { - userById(id: "user-20") { + query ($v0: ID!) { + userById(id: $v0) { name } } - variables: { } + variables: {"v0":"user-20"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml b/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml index b5f563402..4f8b5afcd 100644 --- a/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml +++ b/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml @@ -69,13 +69,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,14 +91,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { bars { - barById(id: "barId") { + barById(id: $v0) { name } } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml index d77ab5820..ea96e8020 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml @@ -67,15 +67,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -90,13 +91,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml index f8e38b384..cd87a4848 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml @@ -67,15 +67,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -90,13 +91,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml index 585541886..a3d9e8006 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml @@ -67,15 +67,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -90,13 +91,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml index 5b642a6ff..366f7874f 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml @@ -71,13 +71,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -93,12 +93,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml index adabbf48e..8dbeda085 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml @@ -69,13 +69,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,12 +91,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - rename__barByIdOverall__barById: barById(id: "barId") { + query ($v0: ID) { + rename__barByIdOverall__barById: barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml index f33e27911..f11f40dc7 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml @@ -64,13 +64,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,12 +86,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId" test: ["Hello", "World"]) { + query ($v0: ID, $v1: [String]) { + barById(id: $v0, test: $v1) { name } } - variables: { } + variables: {"v0":"barId","v1":["Hello","World"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml index 96ee2a52d..e10fa5fcc 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml @@ -64,13 +64,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,12 +86,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId" test: false) { + query ($v0: ID, $v1: Boolean) { + barById(id: $v0, test: $v1) { name } } - variables: { } + variables: {"v0":"barId","v1":false} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml index a23d8321f..7fd989e26 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml @@ -64,13 +64,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,12 +86,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId" test: 10) { + query ($v0: ID, $v1: Int) { + barById(id: $v0, test: $v1) { name } } - variables: { } + variables: {"v0":"barId","v1":10} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml index 92def24cc..9be5fd058 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml @@ -64,13 +64,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,12 +86,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId" test: null) { + query ($v0: ID, $v1: Boolean) { + barById(id: $v0, test: $v1) { name } } - variables: { } + variables: {"v0":"barId","v1":null} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml index 994b66eba..5f3737d2e 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml @@ -79,13 +79,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -101,12 +101,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId" test: {echo: "Hello World"}) { + query ($v0: ID, $v1: Test) { + barById(id: $v0, test: $v1) { name } } - variables: { } + variables: {"v0":"barId","v1":{"echo":"Hello World"}} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml index b185bf0a7..90af72acb 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml @@ -64,13 +64,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,12 +86,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId" test: "Hello World") { + query ($v0: ID, $v1: String) { + barById(id: $v0, test: $v1) { name } } - variables: { } + variables: {"v0":"barId","v1":"Hello World"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml index 016587326..f101e6ef2 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml @@ -61,13 +61,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__id: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -83,12 +83,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId", friendIds: ["barId2", "barId3", "barId4"]) { + query ($v0: ID, $v1: [ID]) { + barById(friendIds: $v1, id: $v0) { name } } - variables: { } + variables: {"v0":"barId","v1":["barId2","barId3","barId4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml index e1b6c7310..bf4e87aec 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml @@ -80,12 +80,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barWithSomeAttribute(someAttribute: true) { + query ($v0: Boolean) { + barWithSomeAttribute(someAttribute: $v0) { name } } - variables: { } + variables: {"v0":true} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml index 5d97ccc08..a2b28bc8a 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml @@ -80,12 +80,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barWithSomeFloat(someFloat: 123.45) { + query ($v0: Float) { + barWithSomeFloat(someFloat: $v0) { name } } - variables: { } + variables: {"v0":123.45} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml index 3a29b29de..1ea0a5f78 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml @@ -78,12 +78,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: 12345) { + query ($v0: Int) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":12345} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml index 4e7fae922..93c962d56 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml @@ -85,13 +85,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__id: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -107,25 +107,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId", friends: [ - { - firstName: "first" - lastName: "last" - }, - { - firstName: "first2" - lastName: "last2" - }, - { - firstName: "first3" - lastName: "last3" - } - ]) { + query ($v0: ID, $v1: [FullName]) { + barById(friends: $v1, id: $v0) { name } } - variables: { } + variables: {"v0":"barId","v1":[{"firstName":"first","lastName":"last"},{"firstName":"first2","lastName":"last2"},{"firstName":"first3","lastName":"last3"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml index 814112bc5..e5cd2e7a4 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml @@ -76,13 +76,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__id: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -98,15 +98,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId", fullName: { - firstName: "first" - lastName: "last" - }) { + query ($v0: ID, $v1: FullName) { + barById(fullName: $v1, id: $v0) { name } } - variables: { } + variables: {"v0":"barId","v1":{"firstName":"first","lastName":"last"}} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml index 71f8874ff..218101799 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml @@ -78,12 +78,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration.yml index b0fccdbea..746dc8f7a 100644 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/basic-hydration.yml @@ -69,13 +69,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,12 +91,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml b/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml index b854886b9..b67929469 100644 --- a/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml +++ b/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml @@ -63,25 +63,26 @@ serviceCalls: request: # language=GraphQL query: | - { - issueById(id: "10000") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__batch_hydration__collaborators: __typename batch_hydration__collaborators__collaboratorIds: collaboratorIds key } } + variables: {"v0":"10000"} # language=JSON - response: | + response: |- { "data": { "issueById": { - "__typename__batch_hydration__collaborators": "Issue", + "key": "GQLGW-1000", "batch_hydration__collaborators__collaboratorIds": [ "100", "NULL/1", "200" ], - "key": "GQLGW-1000" + "__typename__batch_hydration__collaborators": "Issue" } } } @@ -89,27 +90,28 @@ serviceCalls: request: # language=GraphQL query: | - { - usersByIds(ids: ["100", "200"]) { + query ($v0: [ID!]!) { + usersByIds(ids: $v0) { __typename batch_hydration__collaborators__id: id name } } + variables: {"v0":["100","200"]} # language=JSON - response: | + response: |- { "data": { "usersByIds": [ { "__typename": "User", - "batch_hydration__collaborators__id": "100", - "name": "John Doe" + "name": "John Doe", + "batch_hydration__collaborators__id": "100" }, { "__typename": "User", - "batch_hydration__collaborators__id": "200", - "name": "Joe" + "name": "Joe", + "batch_hydration__collaborators__id": "200" } ] } diff --git a/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml b/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml index c65d03336..1e1a38305 100644 --- a/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml +++ b/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml @@ -70,7 +70,7 @@ serviceCalls: title } } - variables: { } + variables: {} # language=JSON response: |- { @@ -89,13 +89,13 @@ serviceCalls: request: # language=GraphQL query: | - { - usersByIds(ids: ["user-256"]) { + query ($v0: [ID!]!) { + usersByIds(ids: $v0) { batch_hydration__assignee__id: id name } } - variables: { } + variables: {"v0":["user-256"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml b/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml index 668db8597..00d583d82 100644 --- a/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml +++ b/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -85,13 +85,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - rename__barsByIdOverall__barsById: barsById(id: ["barId1", "barId2", "barId3"]) { + query ($v0: [ID]) { + rename__barsByIdOverall__barsById: barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml index 62f34ebb9..e2376c424 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml @@ -70,14 +70,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -115,15 +115,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { users { - usersByIds(id: ["USER-4", "USER-5"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-4","USER-5"]} # language=JSON response: |- { @@ -147,15 +147,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { users { - usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml index f82f530d5..0dde32970 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml @@ -65,14 +65,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -110,13 +110,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: ["Hello", "World"]) { + query ($v0: [String], $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["Hello","World"],"v1":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -142,13 +142,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"], test: ["Hello", "World"]) { + query ($v0: [String], $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["Hello","World"],"v1":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml index 8f8ba0000..94e56bf1c 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml @@ -65,14 +65,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -110,13 +110,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: true) { + query ($v0: Boolean, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":true,"v1":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -142,13 +142,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"], test: true) { + query ($v0: Boolean, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":true,"v1":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml index cfe4c49b7..10664a8f9 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml @@ -65,14 +65,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -110,13 +110,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: 42) { + query ($v0: Int, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":42,"v1":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -142,13 +142,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"], test: 42) { + query ($v0: Int, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":42,"v1":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml index 32a3ffa05..afd8a5e35 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml @@ -65,14 +65,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -110,13 +110,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: null) { + query ($v0: String, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":null,"v1":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -142,13 +142,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"], test: null) { + query ($v0: String, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":null,"v1":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml index 361a79c60..a8f243016 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml @@ -79,14 +79,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -124,13 +124,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: {echo: "Hello World"}) { + query ($v0: Test, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":{"echo":"Hello World"},"v1":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -156,13 +156,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"], test: {echo: "Hello World"}) { + query ($v0: Test, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":{"echo":"Hello World"},"v1":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml index ed7926b41..04df58401 100644 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml +++ b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml @@ -65,14 +65,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -110,13 +110,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"], test: "Hello World") { + query ($v0: String, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":"Hello World","v1":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -142,13 +142,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"], test: "Hello World") { + query ($v0: String, $v1: [ID]) { + usersByIds(id: $v1, test: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":"Hello World","v1":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml index 4cc1052a0..ab8b824b0 100644 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml +++ b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml @@ -64,7 +64,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authors: authors { @@ -73,7 +73,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -123,13 +123,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -155,13 +155,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml index 9fb1305bd..2f0ec8332 100644 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml +++ b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml @@ -103,13 +103,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["site-1/user-1"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["site-1/user-1"]} # language=JSON response: |- { @@ -127,13 +127,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["site-2/user-2", "site-2/user-4"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["site-2/user-2","site-2/user-4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml index f1b89bd40..022f6284f 100644 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml +++ b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml @@ -63,14 +63,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -107,13 +107,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["CLOUD-ID-1/USER-1", "CLOUD-ID-1/USER-3"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["CLOUD-ID-1/USER-1","CLOUD-ID-1/USER-3"]} # language=JSON response: |- { @@ -135,13 +135,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["CLOUD-ID-1/USER-5"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["CLOUD-ID-1/USER-5"]} # language=JSON response: |- { @@ -159,13 +159,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["CLOUD-ID-2/USER-2", "CLOUD-ID-2/USER-4"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["CLOUD-ID-2/USER-2","CLOUD-ID-2/USER-4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml index 14ca2061a..a8788d61f 100644 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml +++ b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml @@ -59,14 +59,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -104,13 +104,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -136,13 +136,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-4", "USER-5"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml index cda0b7aa1..bac338cfd 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml @@ -132,15 +132,15 @@ serviceCalls: request: # language=GraphQL query: | - { - issuesByIds(ids: ["issue/1234"]) { + query ($v0: [ID!]!) { + issuesByIds(ids: $v0) { __typename id batch_hydration__content__id: id title } } - variables: { } + variables: {"v0":["issue/1234"]} # language=JSON response: |- { @@ -160,15 +160,15 @@ serviceCalls: request: # language=GraphQL query: | - { - commentsByIds(ids: ["comment/9001"]) { + query ($v0: [ID!]!) { + commentsByIds(ids: $v0) { __typename content id batch_hydration__content__id: id } } - variables: { } + variables: {"v0":["comment/9001"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml index ed3c0959e..b8f6e9a56 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml @@ -87,8 +87,9 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barIds: barIds @@ -97,7 +98,7 @@ serviceCalls: batch_hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -112,14 +113,15 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - othersById(ids: ["barId1", "barId2"]) { + query ($v0: [ID]) { + othersById(ids: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml index 6ae10e155..fbb4dd43b 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml @@ -122,7 +122,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -159,15 +159,15 @@ serviceCalls: request: # language=GraphQL query: | - { - issuesByIds(ids: ["issue/4000"]) { + query ($v0: [ID!]!) { + issuesByIds(ids: $v0) { __typename id batch_hydration__content__id: id title } } - variables: { } + variables: {"v0":["issue/4000"]} # language=JSON response: |- { @@ -187,15 +187,15 @@ serviceCalls: request: # language=GraphQL query: | - { - issuesByIds(ids: ["issue/8080", "issue/7496"]) { + query ($v0: [ID!]!) { + issuesByIds(ids: $v0) { __typename id batch_hydration__content__id: id title } } - variables: { } + variables: {"v0":["issue/8080","issue/7496"]} # language=JSON response: |- { @@ -215,15 +215,15 @@ serviceCalls: request: # language=GraphQL query: | - { - commentsByIds(ids: ["comment/5000", "comment/6000", "comment/1234", "comment/9001"]) { + query ($v0: [ID!]!) { + commentsByIds(ids: $v0) { __typename content id batch_hydration__content__id: id } } - variables: { } + variables: {"v0":["comment/5000","comment/6000","comment/1234","comment/9001"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml index 1cfaba683..010557473 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml @@ -65,14 +65,15 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barIds: barIds } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,14 +87,15 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barsById(ids: ["barId2"]) { + query ($v0: [ID]) { + barsById(ids: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml index ae19a0db0..96aced9b3 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml @@ -87,8 +87,9 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barIds: barIds @@ -97,7 +98,7 @@ serviceCalls: batch_hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -112,14 +113,15 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barsById(ids: ["barId1", "barId2"]) { + query ($v0: [ID]) { + barsById(ids: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml index a2c870bdc..5900bf364 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml @@ -65,14 +65,15 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barIds: barIds } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,14 +87,15 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barsById(ids: [2]) { + query ($v0: [Int]) { + barsById(ids: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":[2]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml index 4d5da9de0..14eb3b3ef 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml @@ -87,8 +87,9 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barIds: barIds @@ -97,7 +98,7 @@ serviceCalls: batch_hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -112,14 +113,15 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - othersById(ids: ["barId1", "barId2"]) { + query ($v0: [ID]) { + othersById(ids: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml index cadadf349..c37b9ccf2 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml @@ -87,8 +87,9 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barIds: barIds @@ -97,7 +98,7 @@ serviceCalls: batch_hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -112,14 +113,15 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - othersById(ids: ["barId1", "barId2"]) { + query ($v0: [ID]) { + othersById(ids: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml index ce6a6b15b..3624dbcb6 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml @@ -103,7 +103,7 @@ serviceCalls: batch_hydration__content__contentIds: contentIds } } - variables: { } + variables: {} # language=JSON response: |- { @@ -145,15 +145,15 @@ serviceCalls: request: # language=GraphQL query: | - { - issuesByIds(ids: ["issue/4000", "issue/8080", "issue/7496", "issue/1234"]) { + query ($v0: [ID!]!) { + issuesByIds(ids: $v0) { __typename id batch_hydration__content__id: id title } } - variables: { } + variables: {"v0":["issue/4000","issue/8080","issue/7496","issue/1234"]} # language=JSON response: |- { @@ -191,15 +191,15 @@ serviceCalls: request: # language=GraphQL query: | - { - commentsByIds(ids: ["comment/5000", "comment/6000", "comment/9001", "comment/1234"]) { + query ($v0: [ID!]!) { + commentsByIds(ids: $v0) { __typename content id batch_hydration__content__id: id } } - variables: { } + variables: {"v0":["comment/5000","comment/6000","comment/9001","comment/1234"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml index 6b8bb1677..b92df9f13 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml @@ -103,7 +103,7 @@ serviceCalls: batch_hydration__content__contentIds: contentIds } } - variables: { } + variables: {} # language=JSON response: |- { @@ -139,15 +139,15 @@ serviceCalls: request: # language=GraphQL query: | - { - issuesByIds(ids: ["issue/7496", "issue/1234"]) { + query ($v0: [ID!]!) { + issuesByIds(ids: $v0) { __typename id batch_hydration__content__id: id title } } - variables: { } + variables: {"v0":["issue/7496","issue/1234"]} # language=JSON response: |- { @@ -173,15 +173,15 @@ serviceCalls: request: # language=GraphQL query: | - { - commentsByIds(ids: ["comment/9001", "comment/1234"]) { + query ($v0: [ID!]!) { + commentsByIds(ids: $v0) { __typename content id batch_hydration__content__id: id } } - variables: { } + variables: {"v0":["comment/9001","comment/1234"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml index f28561efb..0f0c0a33d 100644 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml +++ b/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml @@ -104,7 +104,7 @@ serviceCalls: batch_hydration__content__contentId: contentId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -134,15 +134,15 @@ serviceCalls: request: # language=GraphQL query: | - { - issuesByIds(ids: ["issue/4000", "issue/8080", "issue/7496"]) { + query ($v0: [ID!]!) { + issuesByIds(ids: $v0) { __typename id batch_hydration__content__id: id title } } - variables: { } + variables: {"v0":["issue/4000","issue/8080","issue/7496"]} # language=JSON response: |- { @@ -174,15 +174,15 @@ serviceCalls: request: # language=GraphQL query: | - { - commentsByIds(ids: ["comment/1234"]) { + query ($v0: [ID!]!) { + commentsByIds(ids: $v0) { __typename content id batch_hydration__content__id: id } } - variables: { } + variables: {"v0":["comment/1234"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml index 46156c143..1685dfc1a 100644 --- a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml +++ b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -85,13 +85,13 @@ serviceCalls: request: # language=GraphQL query: | - query nadel_2_service2 { - barsById(id: ["barId1", "barId2", "barId3"]) { + query nadel_2_service2($v0: [ID]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} operationName: "nadel_2_service2" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml index bf1f9a66b..0bf4995db 100644 --- a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml @@ -65,7 +65,7 @@ serviceCalls: batch_hydration__bar__barId: barId } } - variables: { } + variables: {} operationName: "nadel_2_service1" # language=JSON response: |- @@ -86,13 +86,13 @@ serviceCalls: request: # language=GraphQL query: | - query nadel_2_service2 { - barsById(id: ["barId1", "barId2", "barId3"]) { + query nadel_2_service2($v0: [ID]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} operationName: "nadel_2_service2" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml index da1e1309b..d5703eb32 100644 --- a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml @@ -75,7 +75,7 @@ serviceCalls: hydration__bar__barId: barId } } - variables: { } + variables: {} operationName: "nadel_2_service1_TestFoo" # language=JSON response: |- @@ -92,12 +92,12 @@ serviceCalls: request: # language=GraphQL query: | - query nadel_2_service2_TestFoo { - barById(id: "barId") { + query nadel_2_service2_TestFoo($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} operationName: "nadel_2_service2_TestFoo" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml index 86dad1ceb..2d3726b3a 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml @@ -99,7 +99,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -153,14 +153,14 @@ serviceCalls: request: # language=GraphQL query: | - { - issues(issuesInput: [{id: "ISSUE-0", site: "CLOUD-0"}, {id: "ISSUE-1", site: "CLOUD-0"}, {id: "ISSUE-2", site: "CLOUD-0"}, {id: "ISSUE-3", site: "CLOUD-0"}]) { + query ($v0: [IssueInput!]) { + issues(issuesInput: $v0) { description issueId batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {"v0":[{"id":"ISSUE-0","site":"CLOUD-0"},{"id":"ISSUE-1","site":"CLOUD-0"},{"id":"ISSUE-2","site":"CLOUD-0"},{"id":"ISSUE-3","site":"CLOUD-0"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml index 2e768e12a..c7e8aba69 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml @@ -58,13 +58,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -84,13 +84,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["barId1", "barId2", "barId3"]) { + query ($v0: [ID]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml index 55089bdc7..c4be05854 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml @@ -133,13 +133,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issues(issueIds: ["Foo-1", "Foo-2"]) { - batch_hydration__issue__issueId: issueId + query ($v0: [ID]) { + issues(issueIds: $v0) { field + batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {"v0":["Foo-1","Foo-2"]} # language=JSON response: |- { @@ -161,13 +161,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issues(issueIds: ["Foo-3"]) { - batch_hydration__issue__issueId: issueId + query ($v0: [ID]) { + issues(issueIds: $v0) { field + batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {"v0":["Foo-3"]} # language=JSON response: |- { @@ -185,13 +185,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - details(detailIds: ["Foo-1", "Foo-2"]) { + query ($v0: [ID]) { + details(detailIds: $v0) { batch_hydration__detail__detailId: detailId name } } - variables: { } + variables: {"v0":["Foo-1","Foo-2"]} # language=JSON response: |- { @@ -213,13 +213,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - details(detailIds: ["Foo-4"]) { + query ($v0: [ID]) { + details(detailIds: $v0) { batch_hydration__detail__detailId: detailId name } } - variables: { } + variables: {"v0":["Foo-4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml index f69743f18..e89c2e239 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml @@ -115,13 +115,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issues(issueIds: ["Foo-1", "Foo-2"]) { - batch_hydration__issue__issueId: issueId + query ($v0: [ID]) { + issues(issueIds: $v0) { field + batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {"v0":["Foo-1","Foo-2"]} # language=JSON response: |- { @@ -143,13 +143,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issues(issueIds: ["Foo-3"]) { - batch_hydration__issue__issueId: issueId + query ($v0: [ID]) { + issues(issueIds: $v0) { field + batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {"v0":["Foo-3"]} # language=JSON response: |- { @@ -167,13 +167,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - details(detailIds: ["Foo-1", "Foo-2"]) { + query ($v0: [ID]) { + details(detailIds: $v0) { batch_hydration__detail__detailId: detailId name } } - variables: { } + variables: {"v0":["Foo-1","Foo-2"]} # language=JSON response: |- { @@ -195,13 +195,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - details(detailIds: ["Foo-4"]) { + query ($v0: [ID]) { + details(detailIds: $v0) { batch_hydration__detail__detailId: detailId name } } - variables: { } + variables: {"v0":["Foo-4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml index cd2b90b8b..243f7a4a0 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml @@ -97,7 +97,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -151,13 +151,13 @@ serviceCalls: request: # language=GraphQL query: | - { - issues(issuesInput: [{id: "ISSUE-0", site: "CLOUD-0"}, {id: "ISSUE-1", site: "CLOUD-0"}, {id: "ISSUE-2", site: "CLOUD-0"}, {id: "ISSUE-3", site: "CLOUD-0"}]) { + query ($v0: [IssueInput!]) { + issues(issuesInput: $v0) { description issueId } } - variables: { } + variables: {"v0":[{"id":"ISSUE-0","site":"CLOUD-0"},{"id":"ISSUE-1","site":"CLOUD-0"},{"id":"ISSUE-2","site":"CLOUD-0"},{"id":"ISSUE-3","site":"CLOUD-0"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml index c477ab38f..1e99a575c 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml @@ -81,7 +81,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds { @@ -93,7 +93,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -149,15 +149,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(id: [{site: "hello", userId: "USER-1"}, {site: "hello", userId: "USER-2"}, {site: "hello", userId: "USER-3"}]) { + query ($v0: [UserInput]) { + users(id: $v0) { id batch_hydration__authors__id: id name batch_hydration__authors__siteId: siteId } } - variables: { } + variables: {"v0":[{"userId":"USER-1","site":"hello"},{"userId":"USER-2","site":"hello"},{"userId":"USER-3","site":"hello"}]} # language=JSON response: |- { @@ -189,15 +189,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(id: [{site: "jdog", userId: "USER-2"}, {site: "hello", userId: "USER-4"}, {site: "hello", userId: "USER-5"}]) { + query ($v0: [UserInput]) { + users(id: $v0) { id batch_hydration__authors__id: id name batch_hydration__authors__siteId: siteId } } - variables: { } + variables: {"v0":[{"userId":"USER-2","site":"jdog"},{"userId":"USER-4","site":"hello"},{"userId":"USER-5","site":"hello"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml index 61512169c..7ef75619c 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml @@ -83,7 +83,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__author: __typename batch_hydration__author__authorId: authorId { @@ -95,7 +95,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -168,17 +168,12 @@ serviceCalls: query ($v0: [UserInputUnderlying]) { users(id: $v0) { id - name batch_hydration__author__id: id + name batch_hydration__author__siteId: siteId } } - variables: - v0: - - site: "hello" - userId: "USER-5" - - site: "hello" - userId: "USER-2" + variables: {"v0":[{"userId":"USER-5","site":"hello"},{"userId":"USER-2","site":"hello"}]} # language=JSON response: |- { @@ -207,21 +202,12 @@ serviceCalls: query ($v0: [UserInputUnderlying]) { users(id: $v0) { id - name batch_hydration__author__id: id + name batch_hydration__author__siteId: siteId } } - variables: - v0: - - site: "hello" - userId: "USER-1" - - site: "hello" - userId: "USER-3" - - site: "jdog" - userId: "USER-2" - - site: "hello" - userId: "USER-4" + variables: {"v0":[{"userId":"USER-1","site":"hello"},{"userId":"USER-3","site":"hello"},{"userId":"USER-2","site":"jdog"},{"userId":"USER-4","site":"hello"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml index 7f10c0743..a847bc7ef 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml @@ -79,7 +79,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds { @@ -91,7 +91,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -141,15 +141,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(id: [{site: "hello", userId: "USER-2"}, {site: "hello", userId: "USER-3"}, {site: "jdog", userId: "USER-2"}]) { + query ($v0: [UserInput]) { + users(id: $v0) { id batch_hydration__authors__id: id name batch_hydration__authors__siteId: siteId } } - variables: { } + variables: {"v0":[{"userId":"USER-2","site":"hello"},{"userId":"USER-3","site":"hello"},{"userId":"USER-2","site":"jdog"}]} # language=JSON response: |- { @@ -181,15 +181,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(id: [{site: "hello", userId: "USER-5"}]) { + query ($v0: [UserInput]) { + users(id: $v0) { id batch_hydration__authors__id: id name batch_hydration__authors__siteId: siteId } } - variables: { } + variables: {"v0":[{"userId":"USER-5","site":"hello"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml index 86c9ba249..02f2cd18e 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml @@ -79,7 +79,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__author: __typename batch_hydration__author__authorId: authorId { @@ -91,7 +91,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -161,15 +161,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(id: [{site: "hello", userId: "USER-5"}, {site: "hello", userId: "USER-2"}]) { + query ($v0: [UserInput]) { + users(id: $v0) { id - name batch_hydration__author__id: id + name batch_hydration__author__siteId: siteId } } - variables: { } + variables: {"v0":[{"userId":"USER-5","site":"hello"},{"userId":"USER-2","site":"hello"}]} # language=JSON response: |- { @@ -195,15 +195,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(id: [{site: "hello", userId: "USER-1"}, {site: "hello", userId: "USER-3"}, {site: "jdog", userId: "USER-2"}, {site: "hello", userId: "USER-4"}]) { + query ($v0: [UserInput]) { + users(id: $v0) { id - name batch_hydration__author__id: id + name batch_hydration__author__siteId: siteId } } - variables: { } + variables: {"v0":[{"userId":"USER-1","site":"hello"},{"userId":"USER-3","site":"hello"},{"userId":"USER-2","site":"jdog"},{"userId":"USER-4","site":"hello"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml index f82c09365..a8ce1ddbb 100644 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml @@ -97,7 +97,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -151,13 +151,13 @@ serviceCalls: request: # language=GraphQL query: | - { - issues(issuesInput: [{id: "ISSUE-0", site: "CLOUD-0"}, {id: "ISSUE-1", site: "CLOUD-0"}, {id: "ISSUE-2", site: "CLOUD-0"}, {id: "ISSUE-3", site: "CLOUD-0"}]) { + query ($v0: [IssueInput!]) { + issues(issuesInput: $v0) { description issueId } } - variables: { } + variables: {"v0":[{"id":"ISSUE-0","site":"CLOUD-0"},{"id":"ISSUE-1","site":"CLOUD-0"},{"id":"ISSUE-2","site":"CLOUD-0"},{"id":"ISSUE-3","site":"CLOUD-0"}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml b/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml index e1fb0c005..325e1321b 100644 --- a/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml +++ b/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml @@ -89,15 +89,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__type: type hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,13 +112,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "BAR_B") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_B"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml b/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml index e663a99e3..c429a657e 100644 --- a/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml +++ b/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml @@ -89,15 +89,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__type: type hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,13 +112,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "BAR_B") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_B"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml b/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml index 6a63b8c5b..5032ea263 100644 --- a/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml +++ b/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml @@ -89,15 +89,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__type: type hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,13 +112,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "BAR_B") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_B"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml b/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml index e52534e92..76f0a5001 100644 --- a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml @@ -80,8 +80,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - board(id: 1) { + query ($v0: ID) { + board(id: $v0) { __typename__rename__cardChildren: __typename id rename__cardChildren__issueChildren: issueChildren { @@ -95,7 +95,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":1} # language=JSON response: |- { @@ -140,13 +140,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - users(accountIds: ["1", "2", "3"]) { + query ($v0: [ID]) { + users(accountIds: $v0) { accountId batch_hydration__assignee__accountId: accountId } } - variables: { } + variables: {"v0":["1","2","3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml index 66e108f65..eb0084be6 100644 --- a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml @@ -86,8 +86,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - board(id: 1) { + query ($v0: ID) { + board(id: $v0) { __typename__rename__cardChildren: __typename id rename__cardChildren__issueChildren: issueChildren { @@ -100,7 +100,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":1} # language=JSON response: |- { @@ -142,15 +142,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { usersQuery { - users(accountIds: ["1", "2", "3"]) { + users(accountIds: $v0) { accountId batch_hydration__assignee__accountId: accountId } } } - variables: { } + variables: {"v0":["1","2","3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml b/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml index 99f59a5e8..ccb11ad8a 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml @@ -58,13 +58,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -84,13 +84,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["barId1", "barId2", "barId3"]) { + query ($v0: [ID]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml index 3bf06bf7e..0c2372b99 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml @@ -58,13 +58,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -80,12 +80,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId1") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml index 9d5ca9f73..8574ecbcf 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml @@ -73,7 +73,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { testing { movies { __typename__batch_hydration__characters: __typename @@ -83,7 +83,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -118,14 +118,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - characters(ids: ["C1", "C2", "C3"]) { + query ($v0: [ID!]!) { + characters(ids: $v0) { id batch_hydration__characters__id: id name } } - variables: { } + variables: {"v0":["C1","C2","C3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml index 08d891ec5..4341efaf9 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml @@ -63,14 +63,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__author: __typename batch_hydration__author__authorId: authorId id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -89,13 +89,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(extraArg: "extraArg", id: ["USER-1"]) { + query ($v0: String, $v1: [ID]) { + usersByIds(extraArg: $v0, id: $v1) { batch_hydration__author__id: id name } } - variables: { } + variables: {"v0":"extraArg","v1":["USER-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml index f38efaa20..42f951f70 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml @@ -97,15 +97,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { userQuery { - usersByIds(id: ["USER-1"]) { + usersByIds(id: $v0) { id name } } } - variables: { } + variables: {"v0":["USER-1"]} # language=JSON response: |- { @@ -125,7 +125,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorDetails: authorDetails { @@ -134,7 +134,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -160,16 +160,16 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { userQuery { - usersByIds(id: ["USER-1", "USER-2"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id name } } } - variables: { } + variables: {"v0":["USER-1","USER-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml index cfdd9d622..abe3f6e02 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml @@ -89,13 +89,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id name } } - variables: { } + variables: {"v0":["USER-1"]} # language=JSON response: |- { @@ -113,7 +113,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorDetails: authorDetails { @@ -122,7 +122,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -148,14 +148,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id name } } - variables: { } + variables: {"v0":["USER-1","USER-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml index c724efb2f..a0b4c29d6 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml @@ -64,14 +64,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__author: __typename batch_hydration__author__authorId: authorId id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -90,13 +90,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(extraArg1: "extraArg1", extraArg2: 10, id: ["USER-1"]) { + query ($v0: String, $v1: Int, $v2: [ID]) { + usersByIds(extraArg1: $v0, extraArg2: $v1, id: $v2) { batch_hydration__author__id: id name } } - variables: { } + variables: {"v0":"extraArg1","v1":10,"v2":["USER-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml b/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml index 9d0e4760e..bd6acb0d8 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml @@ -70,8 +70,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "1") { + query ($v0: ID) { + issue(id: $v0) { __typename__hydration__issueAuthor: __typename hydration__issueAuthor__author: author { userId @@ -79,7 +79,7 @@ serviceCalls: title } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { @@ -98,12 +98,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - user(id: "1001") { + query ($v0: ID!) { + user(id: $v0) { name } } - variables: { } + variables: {"v0":"1001"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml b/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml index caab7b0be..3c845b2d5 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml @@ -70,8 +70,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "1") { + query ($v0: ID) { + issue(id: $v0) { __typename__hydration__issueAuthor: __typename hydration__issueAuthor__author: author { userId @@ -79,7 +79,7 @@ serviceCalls: title } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { @@ -98,12 +98,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - user(id: "1001") { + query ($v0: ID!) { + user(id: $v0) { name } } - variables: { } + variables: {"v0":"1001"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml b/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml index 6e7379129..9dbf9782d 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml @@ -57,14 +57,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { rename__foo__fooOriginal: fooOriginal { __typename__hydration__fooBar: __typename hydration__fooBar__fooBarId: fooBarId id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -81,12 +81,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "hydrated-bar") { + query ($v0: ID!) { + barById(id: $v0) { id } } - variables: { } + variables: {"v0":"hydrated-bar"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml index 0c061e4a2..1119ba896 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barIds: barIds } } - variables: { } + variables: {} # language=JSON response: |- { @@ -85,13 +85,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId1") { + query ($v0: ID) { + barById(id: $v0) { id name } } - variables: { } + variables: {"v0":"barId1"} # language=JSON response: |- { @@ -107,13 +107,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId3") { + query ($v0: ID) { + barById(id: $v0) { id name } } - variables: { } + variables: {"v0":"barId3"} # language=JSON response: |- { @@ -129,13 +129,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId2") { + query ($v0: ID) { + barById(id: $v0) { id name } } - variables: { } + variables: {"v0":"barId2"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml index dfa6a92a4..b211104d4 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml @@ -58,13 +58,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -84,13 +84,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["barId1", "barId2", "barId3"]) { + query ($v0: [ID]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml index 29bb5ae37..0cf94a2f9 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -85,13 +85,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["barId1", "barId2", "barId3"]) { + query ($v0: [ID]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml index c99796339..0d4d9e625 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml @@ -59,13 +59,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -83,13 +83,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId1") { + query ($v0: ID) { + barById(id: $v0) { id name } } - variables: { } + variables: {"v0":"barId1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml index 1bfba306e..f62cfffcb 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml @@ -52,7 +52,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { nodes { __typename ... on Issue { @@ -64,7 +64,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,10 +91,10 @@ serviceCalls: request: # language=GraphQL query: | - query { - ariById(id: "ari:i-always-forget-the-format/1") + query ($v0: ID!) { + ariById(id: $v0) } - variables: { } + variables: {"v0":"ari:i-always-forget-the-format/1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml index 3349f4ddf..baea03fbe 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml @@ -52,7 +52,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { nodes { ... on Issue { id @@ -63,7 +63,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -87,10 +87,10 @@ serviceCalls: request: # language=GraphQL query: | - query { - idByAri(id: "ari:i-always-forget-the-format/1") + query ($v0: ID!) { + idByAri(id: $v0) } - variables: { } + variables: {"v0":"ari:i-always-forget-the-format/1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml index 51dd348b9..c2e8ab0f0 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml @@ -65,7 +65,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { nodes { ... on Issue { id @@ -80,7 +80,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,10 +111,10 @@ serviceCalls: request: # language=GraphQL query: | - query { - trollName(id: "My Arm") + query ($v0: ID!) { + trollName(id: $v0) } - variables: { } + variables: {"v0":"My Arm"} # language=JSON response: |- { @@ -127,10 +127,10 @@ serviceCalls: request: # language=GraphQL query: | - query { - ariById(id: "Franklin") + query ($v0: ID!) { + ariById(id: $v0) } - variables: { } + variables: {"v0":"Franklin"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml index f6afd10eb..f69b17b78 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml @@ -89,15 +89,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__type: type hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,13 +112,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "BAR_B") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_B"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml index 92e9e280e..4c097f114 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml @@ -89,15 +89,16 @@ variables: { } serviceCalls: - serviceName: "service1" request: + # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__type: type hydration__bar__type: type } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,13 +112,14 @@ serviceCalls: } - serviceName: "service2" request: + # language=GraphQL query: | - query { - barById(id: "BAR_A") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_A"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml b/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml index 228efa521..54e4573ad 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml @@ -91,13 +91,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { board { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -113,13 +113,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "ISSUE-1") { + query ($v0: ID!) { + issue(id: $v0) { __typename__hydration__comments: __typename hydration__comments__cloudId: cloudId } } - variables: { } + variables: {"v0":"ISSUE-1"} # language=JSON response: |- { @@ -135,12 +135,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - comments(cloudId: "CLOUD_ID-1", first: 10) { + query ($v0: ID!, $v1: Int) { + comments(cloudId: $v0, first: $v1) { totalCount } } - variables: { } + variables: {"v0":"CLOUD_ID-1","v1":10} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml b/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml index 16bd2e8f7..4a3287dcd 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml @@ -58,7 +58,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { rename__devOpsRelationships__relationships: relationships { nodes { __typename__hydration__devOpsIssue: __typename @@ -66,7 +66,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -86,12 +86,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "1") { + query ($v0: ID) { + issue(id: $v0) { id } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml b/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml index 6681e1632..6947031e1 100644 --- a/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml +++ b/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml @@ -64,24 +64,25 @@ serviceCalls: request: # language=GraphQL query: | - { - issueById(id: "10000") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__batch_hydration__collaborators: __typename batch_hydration__collaborators__collaboratorIds: collaboratorIds key } } + variables: {"v0":"10000"} # language=JSON - response: | + response: |- { "data": { "issueById": { - "__typename__batch_hydration__collaborators": "Issue", + "key": "GQLGW-1000", "batch_hydration__collaborators__collaboratorIds": [ null, null ], - "key": "GQLGW-1000" + "__typename__batch_hydration__collaborators": "Issue" } } } diff --git a/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml b/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml index ea06186da..0d9af5868 100644 --- a/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml +++ b/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml @@ -60,14 +60,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -104,12 +104,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["site-1/user-1", "site-1/user-3"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id } } - variables: { } + variables: {"v0":["site-1/user-1","site-1/user-3"]} # language=JSON response: |- { @@ -129,12 +129,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["site-1/user-5"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id } } - variables: { } + variables: {"v0":["site-1/user-5"]} # language=JSON response: |- { @@ -151,12 +151,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["site-2/user-2", "site-2/user-4"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id } } - variables: { } + variables: {"v0":["site-2/user-2","site-2/user-4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml index ec5dad064..2b4afd30a 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml @@ -63,14 +63,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -107,12 +107,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { @@ -130,12 +130,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["4"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["4"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml index 3345a9375..9911aff91 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml @@ -101,12 +101,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml index 8d619caf9..4c2b2d178 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml @@ -63,14 +63,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -99,12 +99,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml index b75cac4c1..bb3ed951d 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml @@ -64,14 +64,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -100,12 +100,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml index 6d2d3ee4d..0dfe1ce76 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml @@ -63,14 +63,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -99,12 +99,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml index 22f52119c..bd737e009 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml @@ -66,14 +66,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename id batch_hydration__authors__id: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -97,12 +97,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIssueIds(issueIds: ["ISSUE-1", "ISSUE-2"]) { + query ($v0: [ID]) { + usersByIssueIds(issueIds: $v0) { name } } - variables: { } + variables: {"v0":["ISSUE-1","ISSUE-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml index 4cf616173..13e0f115e 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml @@ -60,14 +60,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename id batch_hydration__authors__id: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,12 +91,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIssueIds(issueIds: ["ISSUE-1", "ISSUE-2"]) { + query ($v0: [ID]) { + usersByIssueIds(issueIds: $v0) { name } } - variables: { } + variables: {"v0":["ISSUE-1","ISSUE-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml index 43a613ec2..798d0e75e 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml @@ -65,14 +65,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -101,12 +101,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml index c9af57958..6945f9628 100644 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml +++ b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml @@ -61,14 +61,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -97,12 +97,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(ids: ["1", "2"]) { + query ($v0: [ID]) { + usersByIds(ids: $v0) { name } } - variables: { } + variables: {"v0":["1","2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml b/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml index 74d380c28..83a0c28ef 100644 --- a/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml +++ b/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml @@ -116,12 +116,12 @@ serviceCalls: - serviceName: "service2" request: query: | - query { - barById(id: "BAR_A") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_A"} # language=JSON response: |- { @@ -135,12 +135,12 @@ serviceCalls: - serviceName: "service2" request: query: | - query { - barById(id: "BAR_B") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"BAR_B"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml b/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml index 599cbd076..0a4c98dda 100644 --- a/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml +++ b/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml @@ -104,13 +104,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { rename__fooService__service: service { __typename__hydration__otherServices: __typename hydration__otherServices__id: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -126,15 +126,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - connection(id: "ID") { + query ($v0: ID) { + connection(id: $v0) { __typename__hydration__nodes: __typename hydration__nodes__edges: edges { node } } } - variables: { } + variables: {"v0":"ID"} # language=JSON response: |- { @@ -154,13 +154,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "1") { + query ($v0: ID) { + node(id: $v0) { __typename__hydration__space: __typename hydration__space__id: id } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { @@ -176,12 +176,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - space(id: "1a") { + query ($v0: ID) { + space(id: $v0) { id } } - variables: { } + variables: {"v0":"1a"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml b/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml index dd39edbfb..1f7996a42 100644 --- a/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml +++ b/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml @@ -63,25 +63,26 @@ serviceCalls: request: # language=GraphQL query: | - { - issueById(id: "10000") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__batch_hydration__collaborators: __typename batch_hydration__collaborators__collaboratorIds: collaboratorIds key } } + variables: {"v0":"10000"} # language=JSON - response: | + response: |- { "data": { "issueById": { - "__typename__batch_hydration__collaborators": "Issue", + "key": "GQLGW-1000", "batch_hydration__collaborators__collaboratorIds": [ "100", null, "200" ], - "key": "GQLGW-1000" + "__typename__batch_hydration__collaborators": "Issue" } } } @@ -89,27 +90,28 @@ serviceCalls: request: # language=GraphQL query: | - { - usersByIds(ids: ["100", "200"]) { + query ($v0: [ID!]!) { + usersByIds(ids: $v0) { __typename batch_hydration__collaborators__id: id name } } + variables: {"v0":["100","200"]} # language=JSON - response: | + response: |- { "data": { "usersByIds": [ { "__typename": "User", - "batch_hydration__collaborators__id": "100", - "name": "John Doe" + "name": "John Doe", + "batch_hydration__collaborators__id": "100" }, { "__typename": "User", - "batch_hydration__collaborators__id": "200", - "name": "Joe" + "name": "Joe", + "batch_hydration__collaborators__id": "200" } ] } diff --git a/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml b/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml index f799cbfd2..4bfd45bc3 100644 --- a/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml +++ b/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml @@ -89,13 +89,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { board { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,13 +111,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(id: "ISSUE-1") { + query ($v0: ID) { + issue(id: $v0) { __typename__hydration__comments: __typename hydration__comments__cloudId: cloudId } } - variables: { } + variables: {"v0":"ISSUE-1"} # language=JSON response: |- { @@ -133,12 +133,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - comments(cloudId: "CLOUD_ID-1") { + query ($v0: ID!) { + comments(cloudId: $v0) { totalCount } } - variables: { } + variables: {"v0":"CLOUD_ID-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml index e08182a8d..16c5dc9d6 100644 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml +++ b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml @@ -74,13 +74,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -96,13 +96,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { id name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml index e88ee88c0..f4e80d44a 100644 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml +++ b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml @@ -69,7 +69,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__barLongerInput: __typename hydration__barLongerInput__fooDetails: fooDetails { @@ -77,7 +77,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -95,12 +95,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml index f593cd1c1..ef5baae34 100644 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml +++ b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml @@ -119,13 +119,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } - variables: { } + variables: {"v0":["USER-1","USER-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml index a0452718e..0da94afe2 100644 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml +++ b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml @@ -67,7 +67,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authors: authors { @@ -76,7 +76,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -102,14 +102,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - usersByIds(id: ["USER-1", "USER-2"]) { + query ($v0: [ID]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id name } } - variables: { } + variables: {"v0":["USER-1","USER-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml index d32f5ce63..39d2ac49f 100644 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml +++ b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml @@ -70,13 +70,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -92,13 +92,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { id name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml b/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml index d82b2785d..72d26c2e3 100644 --- a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml +++ b/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml @@ -126,15 +126,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { usersQuery { - usersByIds(id: ["USER-1", "USER-2"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-1","USER-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml b/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml index 0528ebf4d..78ec25f51 100644 --- a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml +++ b/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml @@ -74,7 +74,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authors: authors { @@ -83,7 +83,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -109,16 +109,16 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { usersQuery { - usersByIds(id: ["USER-1", "USER-2"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id name } } } - variables: { } + variables: {"v0":["USER-1","USER-2"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml index b38f08fc5..d474caa56 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml @@ -103,7 +103,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -112,7 +112,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -154,15 +154,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -188,15 +188,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml index 5443e28b2..c2d9be026 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml @@ -95,7 +95,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -104,7 +104,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -146,15 +146,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -180,15 +180,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml index 4b0796dbf..c45fcd33f 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -148,74 +148,75 @@ serviceCalls: }, "extensions": {} } - - serviceName: "pets" + - serviceName: "people" request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename - breed id batch_hydration__data__id: id + name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { "data": { - "petById": [ - null, + "humanById": [ { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" + "__typename": "Human", + "id": "HUMAN-0", + "batch_hydration__data__id": "HUMAN-0", + "name": "Fanny Longbottom" + }, + { + "__typename": "Human", + "id": "HUMAN-1", + "batch_hydration__data__id": "HUMAN-1", + "name": "John Doe" } ] }, - "errors": [ - { - "message": "invalid id PET-0" - } - ], "extensions": {} } - - serviceName: "people" + - serviceName: "pets" request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename + breed id batch_hydration__data__id: id - name } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, + "petById": [ + null, { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" + "__typename": "Pet", + "breed": "Labrador", + "id": "PET-1", + "batch_hydration__data__id": "PET-1" } ] }, + "errors": [ + { + "message": "invalid id PET-0" + } + ], "extensions": {} } + # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml index 976a2d229..182d7b1a6 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -152,15 +152,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -181,15 +181,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml index d1a87f6ce..101b45465 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -148,43 +148,19 @@ serviceCalls: }, "extensions": {} } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query { - petById(ids: ["PET-0", "PET-1"]) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: { } - # language=JSON - response: |- - { - "data": null, - "errors": [ - { - "message": "something went wrong" - } - ], - "extensions": {} - } - serviceName: "people" request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { @@ -206,6 +182,31 @@ serviceCalls: }, "extensions": {} } + - serviceName: "pets" + request: + # language=GraphQL + query: | + query ($v0: [ID]) { + petById(ids: $v0) { + __typename + breed + id + batch_hydration__data__id: id + } + } + variables: {"v0":["PET-0","PET-1"]} + # language=JSON + response: |- + { + "data": null, + "errors": [ + { + "message": "something went wrong" + } + ], + "extensions": {} + } + # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml index b3e77eb34..706a47819 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -148,38 +148,19 @@ serviceCalls: }, "extensions": {} } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query { - petById(ids: ["PET-0", "PET-1"]) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: { } - # language=JSON - response: |- - { - "data": null, - "extensions": {} - } - serviceName: "people" request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { @@ -201,6 +182,26 @@ serviceCalls: }, "extensions": {} } + - serviceName: "pets" + request: + # language=GraphQL + query: | + query ($v0: [ID]) { + petById(ids: $v0) { + __typename + breed + id + batch_hydration__data__id: id + } + } + variables: {"v0":["PET-0","PET-1"]} + # language=JSON + response: |- + { + "data": null, + "extensions": {} + } + # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml index efa389b36..4f047d23d 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml @@ -152,15 +152,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0"]} # language=JSON response: |- { @@ -180,15 +180,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml index 15ce27924..1f2ed86b7 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml @@ -148,15 +148,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml index ce29346d5..9f78b4438 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml @@ -110,14 +110,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__data: __typename batch_hydration__data__dataId: dataId batch_hydration__data__dataId: dataId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -156,8 +156,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["DOG-0", "FISH-0", "DOG-1", "FISH-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { ... on Dog { batch_hydration__data__id: id } @@ -169,7 +169,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["DOG-0","FISH-0","DOG-1","FISH-1"]} # language=JSON response: |- { @@ -201,12 +201,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["HUMAN-0"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml index 6616d09e9..f9be64a5e 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml @@ -113,7 +113,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -122,7 +122,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -163,15 +163,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -196,15 +196,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml index e8f150673..c226628df 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml @@ -126,7 +126,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -135,7 +135,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -179,8 +179,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["DOG-0", "FISH-0", "DOG-1", "FISH-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename id batch_hydration__data__id: id @@ -192,7 +192,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["DOG-0","FISH-0","DOG-1","FISH-1"]} # language=JSON response: |- { @@ -230,15 +230,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml index 8fb5d9764..c75796521 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -152,8 +152,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename __typename__rename__id: __typename batch_hydration__data__hiddenId: hiddenId @@ -161,7 +161,7 @@ serviceCalls: name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { @@ -189,8 +189,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename __typename__rename__id: __typename __typename__rename__breed: __typename @@ -199,7 +199,7 @@ serviceCalls: rename__breed__kind: kind } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml index 61cf913de..85c424bdc 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -152,8 +152,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename __typename__rename__breed: __typename id @@ -161,7 +161,7 @@ serviceCalls: rename__breed__kind: kind } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -189,15 +189,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml index 9fc8df17a..7ac2b7f54 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml @@ -122,7 +122,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -131,7 +131,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -175,8 +175,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["DOG-0", "FISH-0", "DOG-1", "FISH-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename ... on Dog { breed @@ -190,7 +190,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["DOG-0","FISH-0","DOG-1","FISH-1"]} # language=JSON response: |- { @@ -228,15 +228,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml index 2a201d725..404deae46 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -152,15 +152,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -186,15 +186,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml index 03e76b102..35b7a1222 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml @@ -101,7 +101,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename __typename__batch_hydration__data: __typename @@ -110,7 +110,7 @@ serviceCalls: id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -148,15 +148,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(ids: ["PET-0", "PET-1"]) { + query ($v0: [ID]) { + petById(ids: $v0) { __typename breed id batch_hydration__data__id: id } } - variables: { } + variables: {"v0":["PET-0","PET-1"]} # language=JSON response: |- { @@ -182,15 +182,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(ids: ["HUMAN-0", "HUMAN-1"]) { + query ($v0: [ID]) { + humanById(ids: $v0) { __typename id batch_hydration__data__id: id name } } - variables: { } + variables: {"v0":["HUMAN-0","HUMAN-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml index aaa1d7cfe..1215e4a7a 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml @@ -154,8 +154,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petsByIds(ids: ["good-boye-1", "tall-boye-9"]) { + query ($v0: [ID!]!) { + petsByIds(ids: $v0) { __typename__batch_hydration__animal: __typename batch_hydration__animal__animalId: animalId batch_hydration__animal__animalId: animalId @@ -170,7 +170,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["good-boye-1","tall-boye-9"]} # language=JSON response: |- { @@ -198,14 +198,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - dogsByIds(ids: ["good-boye-1"]) { + query ($v0: [ID!]!) { + dogsByIds(ids: $v0) { __typename batch_hydration__animal__id: id name } } - variables: { } + variables: {"v0":["good-boye-1"]} # language=JSON response: |- { @@ -224,8 +224,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - giraffes(filters: [{birthday: 1001203200, height: 570, nickname: "Tall Boye"}]) { + query ($v0: [GiraffeFilter]) { + giraffes(filters: $v0) { __typename birthday batch_hydration__animal__birthday: birthday @@ -235,7 +235,7 @@ serviceCalls: batch_hydration__animal__nickname: nickname } } - variables: { } + variables: {"v0":[{"nickname":"Tall Boye","birthday":1001203200,"height":570}]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml index 147ee7cda..cd89f0f35 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml @@ -136,8 +136,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(id: "HUMAN-0") { + query ($v0: ID) { + humanById(id: $v0) { __typename __typename__type_filter__id: __typename __typename__type_filter__breed: __typename @@ -145,7 +145,7 @@ serviceCalls: name } } - variables: { } + variables: {"v0":"HUMAN-0"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml index c9c13b4d2..05fd37774 100644 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml @@ -136,8 +136,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - petById(id: "PET-0") { + query ($v0: ID) { + petById(id: $v0) { __typename __typename__type_filter__id: __typename __typename__type_filter__name: __typename @@ -145,7 +145,7 @@ serviceCalls: id } } - variables: { } + variables: {"v0":"PET-0"} # language=JSON response: |- { @@ -164,8 +164,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - humanById(id: "HUMAN-0") { + query ($v0: ID) { + humanById(id: $v0) { __typename __typename__type_filter__id: __typename __typename__type_filter__breed: __typename @@ -173,7 +173,7 @@ serviceCalls: name } } - variables: { } + variables: {"v0":"HUMAN-0"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml b/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml index abc5fd15e..9294b3159 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml @@ -166,8 +166,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { __typename__hydration__owners: __typename name ... on Cat { @@ -178,7 +178,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- @@ -207,8 +207,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - ownerById(id: "dearly") { + query petQ($v0: String) { + ownerById(id: $v0) { name ... on CaringOwner { givesPats @@ -218,7 +218,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"dearly"} operationName: "petQ" # language=JSON response: |- @@ -235,8 +235,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - ownerById(id: "cruella") { + query petQ($v0: String) { + ownerById(id: $v0) { name ... on CaringOwner { givesPats @@ -246,7 +246,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"cruella"} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml b/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml index 44463fa38..b81dde230 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml @@ -72,13 +72,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -94,14 +94,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId123") { + query ($v0: ID) { + barById(id: $v0) { __typename__hydration__nestedBar: __typename name hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":"barId123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml b/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml index e55d01416..802e8d9e1 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml @@ -79,13 +79,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -101,16 +101,16 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { barQuery { - barById(id: "barId123") { + barById(id: $v0) { __typename__hydration__nestedBar: __typename name hydration__nestedBar__nestedBarId: nestedBarId } } } - variables: { } + variables: {"v0":"barId123"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml index 9953d9ca9..e3cce108e 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml @@ -131,7 +131,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { rename__fooz__foos: foos { __typename__rename__fooDetails: __typename __typename__batch_hydration__bar: __typename @@ -151,7 +151,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -183,8 +183,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["bar1"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__rename__barName: __typename __typename__batch_hydration__nestedBar: __typename batch_hydration__bar__barId: barId @@ -192,7 +192,7 @@ serviceCalls: batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["bar1"]} # language=JSON response: |- { @@ -213,8 +213,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["nestedBar1"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__rename__barName: __typename __typename__batch_hydration__nestedBar: __typename batch_hydration__nestedBar__barId: barId @@ -222,7 +222,7 @@ serviceCalls: batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["nestedBar1"]} # language=JSON response: |- { @@ -243,8 +243,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["nestedBarId456"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__rename__barName: __typename __typename__rename__barDetails: __typename batch_hydration__nestedBar__barId: barId @@ -262,7 +262,7 @@ serviceCalls: rename__barName__name: name } } - variables: { } + variables: {"v0":["nestedBarId456"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml index 22a0bbed3..8a2215b6f 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml @@ -76,13 +76,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foos { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -100,15 +100,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["bar1"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__bar__barId: barId name batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["bar1"]} # language=JSON response: |- { @@ -128,15 +128,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["nestedBar1"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__nestedBar__barId: barId name batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["nestedBar1"]} # language=JSON response: |- { @@ -156,13 +156,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["nestedBarId456"]) { + query ($v0: [ID]) { + barsById(id: $v0) { batch_hydration__nestedBar__barId: barId name } } - variables: { } + variables: {"v0":["nestedBarId456"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml index 2c1a8dda6..95fb914a2 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml @@ -83,13 +83,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foos { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -115,9 +115,9 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { barsQuery { - barsById(id: ["bar3"]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__bar__barId: barId name @@ -125,7 +125,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["bar3"]} # language=JSON response: |- { @@ -147,9 +147,9 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { barsQuery { - barsById(id: ["bar1", "bar2"]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__bar__barId: barId name @@ -157,7 +157,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["bar1","bar2"]} # language=JSON response: |- { @@ -185,9 +185,9 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { barsQuery { - barsById(id: ["nestedBar1", "nestedBar2"]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__nestedBar__barId: barId name @@ -195,7 +195,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":["nestedBar1","nestedBar2"]} # language=JSON response: |- { @@ -217,15 +217,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { barsQuery { - barsById(id: ["nestedBarId456"]) { + barsById(id: $v0) { batch_hydration__nestedBar__barId: barId name } } } - variables: { } + variables: {"v0":["nestedBarId456"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml index 05044fd2c..c71a6d90a 100644 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml +++ b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml @@ -76,13 +76,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foos { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -108,15 +108,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["bar3"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__bar__barId: barId name batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["bar3"]} # language=JSON response: |- { @@ -136,15 +136,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["bar1", "bar2"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__bar__barId: barId name batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["bar1","bar2"]} # language=JSON response: |- { @@ -170,15 +170,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["nestedBar1", "nestedBar2"]) { + query ($v0: [ID]) { + barsById(id: $v0) { __typename__batch_hydration__nestedBar: __typename batch_hydration__nestedBar__barId: barId name batch_hydration__nestedBar__nestedBarId: nestedBarId } } - variables: { } + variables: {"v0":["nestedBar1","nestedBar2"]} # language=JSON response: |- { @@ -198,13 +198,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barsById(id: ["nestedBarId456"]) { + query ($v0: [ID]) { + barsById(id: $v0) { batch_hydration__nestedBar__barId: barId name } } - variables: { } + variables: {"v0":["nestedBarId456"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml b/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml index 62c5742b5..8d0d505fa 100644 --- a/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml +++ b/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml @@ -59,7 +59,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__deep_rename__renamedField: __typename __typename__hydration__details: __typename @@ -71,7 +71,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -93,12 +93,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - detail(detailId: "ID") { + query ($v0: ID) { + detail(detailId: $v0) { name } } - variables: { } + variables: {"v0":"ID"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml index 824e9ac30..802d61b8a 100644 --- a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml +++ b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml @@ -81,14 +81,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(issueId: "ISSUE-1") { + query ($v0: ID) { + issue(issueId: $v0) { desc name summary } } - variables: { } + variables: {"v0":"ISSUE-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml index 58078c37f..50f1ece47 100644 --- a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml @@ -55,13 +55,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__issue: __typename batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -77,14 +77,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - issues(issueIds: ["ISSUE-1"]) { + query ($v0: [ID!]) { + issues(issueIds: $v0) { desc batch_hydration__issue__id: id name } } - variables: { } + variables: {"v0":["ISSUE-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml index 7202a4979..53e2ed0cb 100644 --- a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml +++ b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml @@ -55,13 +55,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -77,13 +77,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(issueId: "ISSUE-1") { + query ($v0: ID) { + issue(issueId: $v0) { desc name } } - variables: { } + variables: {"v0":"ISSUE-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml b/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml index e6662962b..0e187a044 100644 --- a/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml +++ b/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml @@ -98,12 +98,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(issueId: "ID") { + query ($v0: ID) { + issue(issueId: $v0) { field } } - variables: { } + variables: {"v0":"ID"} # language=JSON response: |- { @@ -118,12 +118,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - detail(detailId: "ID") { + query ($v0: ID) { + detail(detailId: $v0) { name } } - variables: { } + variables: {"v0":"ID"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml b/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml index 3ff823f53..4a4cfbc06 100644 --- a/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml +++ b/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml @@ -116,12 +116,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - issue(issueId: "ID") { + query ($v0: ID) { + issue(issueId: $v0) { field } } - variables: { } + variables: {"v0":"ID"} # language=JSON response: |- { @@ -136,12 +136,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - detail(detailId: "ID") { + query ($v0: ID) { + detail(detailId: $v0) { name } } - variables: { } + variables: {"v0":"ID"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml b/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml index 07b7a8a2e..943aff1d3 100644 --- a/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml +++ b/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml @@ -65,13 +65,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issue { __typename__hydration__project: __typename hydration__project__projectId: projectId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -87,14 +87,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { projects { - project(id: "project1") { + project(id: $v0) { name } } } - variables: { } + variables: {"v0":"project1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml b/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml index 1b51ce34f..ae956d11b 100644 --- a/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml +++ b/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml @@ -77,7 +77,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { tests { testing { movie { @@ -89,7 +89,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -111,15 +111,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { tests { - character(id: "C1") { + character(id: $v0) { id name } } } - variables: { } + variables: {"v0":"C1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml index 4ee100b62..10761c43e 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml @@ -65,13 +65,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,15 +91,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { barsQuery { - barsById(id: ["barId1", "barId2", "barId3"]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml index 5475f21cf..6d7be7242 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml @@ -79,7 +79,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { tests { testing { movies { @@ -91,7 +91,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -128,16 +128,16 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID!]!) { tests { - characters(ids: ["C1", "C2", "C3"]) { + characters(ids: $v0) { id batch_hydration__characters__id: id name } } } - variables: { } + variables: {"v0":["C1","C2","C3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml index 4cb36d61e..0cc4d5242 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml @@ -71,14 +71,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__author: __typename batch_hydration__author__authorId: authorId id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -97,15 +97,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: String, $v1: Int, $v2: [ID]) { usersQuery { - usersByIds(extraArg1: "extraArg1", extraArg2: 10, id: ["USER-1"]) { + usersByIds(extraArg1: $v0, extraArg2: $v1, id: $v2) { batch_hydration__author__id: id name } } } - variables: { } + variables: {"v0":"extraArg1","v1":10,"v2":["USER-1"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml index e76978fa8..bc1b303cb 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml @@ -65,13 +65,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -87,14 +87,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { barsQuery { - barById(id: "barId1") { + barById(id: $v0) { name } } } - variables: { } + variables: {"v0":"barId1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml index b95d20ec5..e04119d79 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml @@ -65,13 +65,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__batch_hydration__bar: __typename batch_hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -91,15 +91,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { barsQuery { - barsById(id: ["barId1", "barId2", "barId3"]) { + barsById(id: $v0) { batch_hydration__bar__id: id name } } } - variables: { } + variables: {"v0":["barId1","barId2","barId3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml index 118c005bc..c96968c6d 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml @@ -64,14 +64,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { rename__foo__fooOriginal: fooOriginal { __typename__hydration__fooBar: __typename hydration__fooBar__fooBarId: fooBarId id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -88,14 +88,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID!) { bars { - barById(id: "hydrated-bar") { + barById(id: $v0) { id } } } - variables: { } + variables: {"v0":"hydrated-bar"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml index 1d6807f67..fba1043fb 100644 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml +++ b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml @@ -65,7 +65,7 @@ serviceCalls: request: # language=GraphQL query: | - query { + { rename__devOpsRelationships__relationships: relationships { __typename__rename__devOpsNodes: __typename rename__devOpsNodes__nodes: nodes { @@ -74,7 +74,7 @@ serviceCalls: } } } - variables: { } + variables: {} # language=JSON response: |- { @@ -95,14 +95,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { syntheticIssue { - issue(id: "1") { + issue(id: $v0) { id } } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml index 97dcaecad..a117e4c2a 100644 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml @@ -72,14 +72,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -117,15 +117,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { users { - usersByIds(id: ["USER-4", "USER-5"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -140,15 +140,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { users { - usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml index 2fa5af229..51f1899f4 100644 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml @@ -65,13 +65,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issue { __typename__hydration__project: __typename hydration__project__projectId: projectId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -87,14 +87,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { projects { - project(id: "project1") { + project(id: $v0) { name } } } - variables: { } + variables: {"v0":"project1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml index 697ad2054..65b632eef 100644 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml @@ -67,14 +67,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issues { __typename__batch_hydration__authors: __typename batch_hydration__authors__authorIds: authorIds id } } - variables: { } + variables: {} # language=JSON response: |- { @@ -112,15 +112,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { users { - usersByIds(id: ["USER-1", "USER-2", "USER-3"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-1","USER-2","USER-3"]} # language=JSON response: |- { @@ -133,15 +133,15 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: [ID]) { users { - usersByIds(id: ["USER-4", "USER-5"]) { + usersByIds(id: $v0) { id batch_hydration__authors__id: id } } } - variables: { } + variables: {"v0":["USER-4","USER-5"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml index 734de8561..173fe072a 100644 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml +++ b/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml @@ -65,13 +65,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { issue { __typename__hydration__project: __typename hydration__project__projectId: projectId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -87,14 +87,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + query ($v0: ID) { projects { - project(id: "project1") { + project(id: $v0) { name } } } - variables: { } + variables: {"v0":"project1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml b/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml index 0aa22ae8e..cfa267c57 100644 --- a/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml +++ b/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml @@ -58,13 +58,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -80,12 +80,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "transformed-id") { + query ($v0: ID) { + barById(id: $v0) { name } } - variables: { } + variables: {"v0":"transformed-id"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/oneOf/one-of-successful.yml b/test/src/test/resources/fixtures/oneOf/one-of-successful.yml index 542b2adc1..c62de58b8 100644 --- a/test/src/test/resources/fixtures/oneOf/one-of-successful.yml +++ b/test/src/test/resources/fixtures/oneOf/one-of-successful.yml @@ -31,10 +31,10 @@ serviceCalls: request: # language=GraphQL query: | - query myQuery { - search(by: {name: "Figaro"}) + query myQuery($v0: SearchInput) { + search(by: $v0) } - variables: { } + variables: {"v0":{"name":"Figaro"}} operationName: "myQuery" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml b/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml index b8ac5bd48..68dc5ca60 100644 --- a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml +++ b/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml @@ -141,15 +141,15 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { collar { color } name } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml b/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml index f3536432a..1aaa31aa7 100644 --- a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml +++ b/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml @@ -141,8 +141,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { __typename__rename__collarToRenamed: __typename name ... on Cat { @@ -157,7 +157,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml index 5435c31b0..1f1bc8a78 100644 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml +++ b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml @@ -152,8 +152,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - raining(isLoyal: true) { + query petQ($v0: Boolean) { + raining(isLoyal: $v0) { ... on Cat { wearsBell } @@ -162,7 +162,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- @@ -178,8 +178,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { name ... on Cat { wearsBell @@ -189,7 +189,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml index 9384ea354..3cf3742bf 100644 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml +++ b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml @@ -148,8 +148,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { name ... on Cat { aliasedCatTypeName: __typename @@ -161,7 +161,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml index ffe62cc1f..17ba9c97c 100644 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml +++ b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml @@ -154,8 +154,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { name ... on Cat { wearsBell @@ -166,7 +166,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- @@ -190,8 +190,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - raining(isLoyal: true) { + query petQ($v0: Boolean) { + raining(isLoyal: $v0) { __typename ... on Cat { wearsBell @@ -201,7 +201,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml index 5720910da..2e62c3561 100644 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml +++ b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml @@ -162,8 +162,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { __typename name ... on Cat { @@ -174,7 +174,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- @@ -199,8 +199,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - raining(isLoyal: true) { + query petQ($v0: Boolean) { + raining(isLoyal: $v0) { __typename ... on Cat { wearsBell @@ -210,7 +210,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml index 96058c05d..2f1534932 100644 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml +++ b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml @@ -155,8 +155,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - raining(isLoyal: true) { + query petQ($v0: Boolean) { + raining(isLoyal: $v0) { __typename ... on Cat { wearsBell @@ -166,7 +166,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- @@ -183,8 +183,8 @@ serviceCalls: request: # language=GraphQL query: | - query petQ { - pets(isLoyal: true) { + query petQ($v0: Boolean) { + pets(isLoyal: $v0) { __typename name ... on Cat { @@ -195,7 +195,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":true} operationName: "petQ" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml b/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml index a1c216a0f..5c26b62e1 100644 --- a/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml +++ b/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml @@ -51,17 +51,17 @@ variables: { } serviceCalls: - serviceName: "MyService" request: - # Notice the changed values to "aaarrg" and "Asia" + # language=GraphQL query: | - query { - rename__test__world: world(arg: "aaarrg") { + query ($v0: Continent, $v1: String) { + rename__test__world: world(arg: $v1) { __typename __typename__rename__cities: __typename id - rename__cities__places: places(continent: Asia) + rename__cities__places: places(continent: $v0) } } - variables: { } + variables: {"v0":"Asia","v1":"aaarrg"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/chain-rename-transform.yml b/test/src/test/resources/fixtures/renames/chain-rename-transform.yml index f17417392..30f57d4ac 100644 --- a/test/src/test/resources/fixtures/renames/chain-rename-transform.yml +++ b/test/src/test/resources/fixtures/renames/chain-rename-transform.yml @@ -51,17 +51,17 @@ variables: { } serviceCalls: - serviceName: "MyService" request: - # Notice the changed values to "aaarrg" and "Asia" + # language=GraphQL query: | - query { - rename__test__world: world(arg: "aaarrg") { + query ($v0: Continent, $v1: String) { + rename__test__world: world(arg: $v1) { __typename __typename__rename__cities: __typename id - rename__cities__places: places(continent: Asia) + rename__cities__places: places(continent: $v0) } } - variables: { } + variables: {"v0":"Asia","v1":"aaarrg"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml b/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml index a76d86039..77e50ed7b 100644 --- a/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml +++ b/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml @@ -71,13 +71,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -93,13 +93,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { __typename__rename__title: __typename rename__title__name: name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml b/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml index ee396fe79..33e4a0258 100644 --- a/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml +++ b/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml @@ -69,13 +69,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foos { __typename__hydration__bar: __typename hydration__bar__barId: barId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -97,13 +97,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId") { + query ($v0: ID) { + barById(id: $v0) { __typename__rename__title: __typename rename__title__name: name } } - variables: { } + variables: {"v0":"barId"} # language=JSON response: |- { @@ -119,13 +119,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - barById(id: "barId2") { + query ($v0: ID) { + barById(id: $v0) { __typename__rename__title: __typename rename__title__name: name } } - variables: { } + variables: {"v0":"barId2"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml b/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml index cf64edc5b..901252dc1 100644 --- a/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml +++ b/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml @@ -61,12 +61,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - node(id: "world-1") { + query ($v0: ID) { + node(id: $v0) { id } } - variables: { } + variables: {"v0":"world-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml b/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml index 601afdc1f..da5c4b961 100644 --- a/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml +++ b/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml @@ -32,12 +32,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - rename__renameObject__renameObjectUnderlying: renameObjectUnderlying(id: "OBJECT-001") { + query ($v0: ID!) { + rename__renameObject__renameObjectUnderlying: renameObjectUnderlying(id: $v0) { name } } - variables: { } + variables: {"v0":"OBJECT-001"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml index a61f5cc3f..5278b8129 100644 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml +++ b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml @@ -68,13 +68,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { users { __typename__batch_hydration__issue: __typename batch_hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -100,8 +100,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issuesByIds(id: ["issue-1", "issue-2", "issue-3"]) { + query ($v0: [ID!]) { + issuesByIds(id: $v0) { details { __typename name @@ -109,7 +109,7 @@ serviceCalls: batch_hydration__issue__id: id } } - variables: { } + variables: {"v0":["issue-1","issue-2","issue-3"]} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml index f918f2d03..7087183b2 100644 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml +++ b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml @@ -53,8 +53,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-1") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__deep_rename__assignee: __typename deep_rename__assignee__details: details { assignee { @@ -67,7 +67,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"issue-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml index 708072dab..1a7291adf 100644 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml +++ b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml @@ -53,8 +53,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-1") { + query ($v0: ID!) { + issueById(id: $v0) { __typename__deep_rename__assignee: __typename deep_rename__assignee__details: details { assignee { @@ -67,7 +67,7 @@ serviceCalls: } } } - variables: { } + variables: {"v0":"issue-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml index e66fbccf4..f8d17aca6 100644 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml +++ b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml @@ -67,13 +67,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { me { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -89,15 +89,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-2") { + query ($v0: ID!) { + issueById(id: $v0) { details { __typename name } } } - variables: { } + variables: {"v0":"issue-2"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml index 29d44e3dd..9d699a4c3 100644 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml +++ b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml @@ -67,13 +67,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { me { __typename__hydration__issue: __typename hydration__issue__issueId: issueId } } - variables: { } + variables: {} # language=JSON response: |- { @@ -89,15 +89,15 @@ serviceCalls: request: # language=GraphQL query: | - query { - issueById(id: "issue-2") { + query ($v0: ID!) { + issueById(id: $v0) { details { __typename name } } } - variables: { } + variables: {"v0":"issue-2"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml b/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml index dd58f0db1..a5f4e61a8 100644 --- a/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml +++ b/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml @@ -132,8 +132,8 @@ serviceCalls: request: # language=GraphQL query: | - query { - service(id: "service-1") { + query ($v0: ID!) { + service(id: $v0) { __typename dependedOn { __typename @@ -319,7 +319,7 @@ serviceCalls: name } } - variables: { } + variables: {"v0":"service-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml b/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml index d22d693ce..4991deb02 100644 --- a/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml +++ b/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml @@ -102,10 +102,10 @@ serviceCalls: request: # language=GraphQL query: | - query X { - renameInput(arg1: {inputVal: "x"}) + query X($v0: InputUnderlying!) { + renameInput(arg1: $v0) } - variables: { } + variables: {"v0":{"inputVal":"x"}} operationName: "X" # language=JSON response: |- diff --git a/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml b/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml index c90da0aeb..a1c2c583f 100644 --- a/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml +++ b/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml @@ -51,12 +51,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - foo(id: "1") { + query ($v0: ID!) { + foo(id: $v0) { name } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { @@ -71,12 +71,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - loot: foo(id: "1") { + query ($v0: ID!) { + loot: foo(id: $v0) { name } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { @@ -91,12 +91,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - bar(id: "1") { + query ($v0: ID!) { + bar(id: $v0) { name } } - variables: { } + variables: {"v0":"1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml b/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml index 2840a71a9..b69710f22 100644 --- a/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml +++ b/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml @@ -34,12 +34,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - foo(input: "2022-03-09T05:01:50Z") { + query ($v0: DateTime) { + foo(input: $v0) { thing } } - variables: { } + variables: {"v0":"2022-03-09T05:01:50Z"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml b/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml index 481e492a2..0dcf8a600 100644 --- a/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml +++ b/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml @@ -62,10 +62,7 @@ serviceCalls: hydration__foo__id: id } } - variables: - v0: - something: true - answer: "42" + variables: {"v0":{"something":true,"answer":"42"}} # language=JSON response: |- { @@ -81,12 +78,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - otherFoo(id: "10000") { + query ($v0: ID!) { + otherFoo(id: $v0) { id } } - variables: { } + variables: {"v0":"10000"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml b/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml index c60dde013..5cf56b259 100644 --- a/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml +++ b/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml @@ -45,13 +45,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__successor: __typename hydration__successor__createdAt: createdAt } } - variables: { } + variables: {} # language=JSON response: |- { @@ -67,12 +67,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - successor(after: "2022-03-09T05:01:50Z") { + query ($v0: DateTime) { + successor(after: $v0) { id } } - variables: { } + variables: {"v0":"2022-03-09T05:01:50Z"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml b/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml index e59800bda..e16261a34 100644 --- a/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml +++ b/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml @@ -45,13 +45,13 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__successor: __typename hydration__successor__createdAt: createdAt } } - variables: { } + variables: {} # language=JSON response: |- { @@ -67,12 +67,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - successor(after: 3000000000) { + query ($v0: Long) { + successor(after: $v0) { id } } - variables: { } + variables: {"v0":3000000000} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml b/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml index 94203dcfe..1c4c01de2 100644 --- a/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml +++ b/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml @@ -59,14 +59,14 @@ serviceCalls: request: # language=GraphQL query: | - query { + { foo { __typename__hydration__details: __typename url hydration__details__url: url } } - variables: { } + variables: {} # language=JSON response: |- { @@ -83,14 +83,14 @@ serviceCalls: request: # language=GraphQL query: | - query { - lookup(url: "https://github.com/atlassian-labs/nadel") { + query ($v0: URL) { + lookup(url: $v0) { baseUrl createdAt owner } } - variables: { } + variables: {"v0":"https://github.com/atlassian-labs/nadel"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml b/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml index 3f4e40d45..d1a474b8d 100644 --- a/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml +++ b/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml @@ -24,10 +24,10 @@ serviceCalls: request: # language=GraphQL query: | - query { - getFoo(arg: 15) + query ($v0: Long) { + getFoo(arg: $v0) } - variables: { } + variables: {"v0":15} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml b/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml index 1aa1d67c7..e4295a4b6 100644 --- a/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml +++ b/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml @@ -34,12 +34,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - foo(input: 3000000000) { + query ($v0: Long) { + foo(input: $v0) { thing } } - variables: { } + variables: {"v0":3000000000} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml b/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml index 747f1318d..87045272e 100644 --- a/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml +++ b/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml @@ -34,12 +34,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - foo(input: "https://atlassian.com") { + query ($v0: URL) { + foo(input: $v0) { thing } } - variables: { } + variables: {"v0":"https://atlassian.com"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml b/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml index 44f5f05d0..7fe398e54 100644 --- a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml +++ b/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml @@ -65,12 +65,12 @@ serviceCalls: request: # language=GraphQL query: | - query { - fooById(id: "Foo-1") { + query ($v0: ID) { + fooById(id: $v0) { __typename__skip_include____skip: __typename } } - variables: { } + variables: {"v0":"Foo-1"} # language=JSON response: |- { diff --git a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml b/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml index 003cb9852..463b0aba7 100644 --- a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml +++ b/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml @@ -77,13 +77,13 @@ serviceCalls: request: # language=GraphQL query: | - query { - tests(ids: ["Foo-3", "Foo-4"]) { + query ($v0: [ID]) { + tests(ids: $v0) { __typename__skip_include____skip: __typename batch_hydration__test__id: id } } - variables: { } + variables: {"v0":["Foo-3","Foo-4"]} # language=JSON response: |- { From 8d8997bd90ffd9fb03a67b9419dcb43967d006ab Mon Sep 17 00:00:00 2001 From: Artyom Emelyanenko Date: Mon, 27 Jul 2026 20:36:09 +1000 Subject: [PATCH 2/5] Compare service requests ignoring variable names --- .../kotlin/graphql/nadel/tests/EngineTests.kt | 21 +-- .../tests/ServiceRequestCanonicalizer.kt | 115 --------------- .../tests/ServiceRequestCanonicalizerTest.kt | 76 ---------- .../nadel/tests/ServiceRequestComparator.kt | 132 ++++++++++++++++++ .../tests/ServiceRequestComparatorTest.kt | 101 ++++++++++++++ .../nadel/tests/next/NadelIntegrationTest.kt | 25 ++-- .../nadel/tests/next/TestExecutionCapture.kt | 15 +- 7 files changed, 264 insertions(+), 221 deletions(-) delete mode 100644 test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt delete mode 100644 test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt create mode 100644 test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparator.kt create mode 100644 test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparatorTest.kt diff --git a/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt b/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt index a3d94aa5a..2c3320112 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt @@ -5,6 +5,8 @@ import graphql.GraphQLError import graphql.incremental.DeferPayload import graphql.incremental.DelayedIncrementalPartialResult import graphql.incremental.DelayedIncrementalPartialResultImpl.newIncrementalExecutionResult +import graphql.language.AstPrinter +import graphql.language.AstSorter import graphql.nadel.Nadel import graphql.nadel.NadelExecutionHints import graphql.nadel.NadelExecutionInput.Companion.newNadelExecutionInput @@ -162,6 +164,7 @@ private suspend fun execute( .overallWiringFactory(testHook.wiringFactory) .underlyingWiringFactory(testHook.wiringFactory) .serviceExecutionFactory(object : ServiceExecutionFactory { + private val astSorter = AstSorter() private val serviceCalls = fixture.serviceCalls.toMutableList() override fun getServiceExecution(serviceName: String): ServiceExecution { @@ -170,11 +173,9 @@ private suspend fun execute( val incomingQuery = params.query val actualVariables = fixVariables(params.variables) val actualOperationName = params.operationDefinition.name - val actualRequest = canonicalizeServiceRequest( - document = incomingQuery, - variables = actualVariables, + val actualQuery = AstPrinter.printAst( + astSorter.sort(incomingQuery), ) - val actualQuery = actualRequest.query printSyncLine(actualQuery) fun failWithFixtureContext(message: String): Nothing { @@ -192,14 +193,14 @@ private suspend fun execute( synchronized(serviceCalls) { val indexOfCall = serviceCalls .indexOfFirst { - val expectedRequest = canonicalizeServiceRequest( - document = it.request.document, - variables = it.request.variables, - ) - it.serviceName == serviceName - && expectedRequest == actualRequest && it.request.operationName == actualOperationName + && serviceRequestsMatchIgnoringVariableNames( + expectedDocument = it.request.document, + expectedVariables = it.request.variables, + actualDocument = incomingQuery, + actualVariables = actualVariables, + ) } .takeIf { it != -1 } diff --git a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt deleted file mode 100644 index 80f0d0eab..000000000 --- a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizer.kt +++ /dev/null @@ -1,115 +0,0 @@ -package graphql.nadel.tests - -import graphql.language.AstPrinter -import graphql.language.AstSorter -import graphql.language.AstTransformer -import graphql.language.Document -import graphql.language.Node -import graphql.language.NodeTraverser -import graphql.language.NodeVisitorStub -import graphql.language.OperationDefinition -import graphql.language.VariableDefinition -import graphql.language.VariableReference -import graphql.nadel.engine.util.JsonMap -import graphql.parser.Parser -import graphql.util.TraversalControl -import graphql.util.TraverserContext -import graphql.util.TreeTransformerUtil.changeNode - -internal data class CanonicalServiceRequest( - val query: String, - val variables: JsonMap, -) - -internal fun canonicalizeServiceRequest( - query: String, - variables: JsonMap, -): CanonicalServiceRequest { - return canonicalizeServiceRequest( - document = Parser().parseDocument(query), - variables = variables, - ) -} - -internal fun canonicalizeServiceRequest( - document: Document, - variables: JsonMap, -): CanonicalServiceRequest { - val sortedDocument = AstSorter().sort(document) - val variableNames = linkedSetOf() - - NodeTraverser().preOrder( - object : NodeVisitorStub() { - override fun visitVariableReference( - node: VariableReference, - context: TraverserContext>, - ): TraversalControl { - variableNames += node.name - return TraversalControl.CONTINUE - } - }, - sortedDocument, - ) - - val operation = sortedDocument.definitions - .filterIsInstance() - .single() - val definedVariableNames = operation.variableDefinitions - .mapTo(linkedSetOf()) { it.name } - - require(variableNames == definedVariableNames) { - "Service query variable definitions and references must match" - } - require(variables.keys.all(definedVariableNames::contains)) { - "Service variables must be declared by the service query" - } - - val canonicalNames = variableNames - .withIndex() - .associate { (index, name) -> - name to "v$index" - } - - val renamedDocument = AstTransformer().transform( - sortedDocument, - object : NodeVisitorStub() { - override fun visitVariableDefinition( - node: VariableDefinition, - context: TraverserContext>, - ): TraversalControl { - return changeNode( - context, - node.transform { builder -> - builder.name(canonicalNames.getValue(node.name)) - }, - ) - } - - override fun visitVariableReference( - node: VariableReference, - context: TraverserContext>, - ): TraversalControl { - return changeNode( - context, - node.transform { builder -> - builder.name(canonicalNames.getValue(node.name)) - }, - ) - } - }, - ) as Document - - val canonicalVariables = linkedMapOf() - canonicalNames.forEach { (name, canonicalName) -> - if (variables.containsKey(name)) { - canonicalVariables[canonicalName] = variables[name] - } - } - - return CanonicalServiceRequest( - query = AstPrinter.printAst( - AstSorter().sort(renamedDocument), - ), - variables = canonicalVariables, - ) -} diff --git a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt deleted file mode 100644 index 9824e2919..000000000 --- a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestCanonicalizerTest.kt +++ /dev/null @@ -1,76 +0,0 @@ -package graphql.nadel.tests - -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertNotEquals - -class ServiceRequestCanonicalizerTest { - @Test - fun `variable names and definition order do not affect a service request`() { - val expected = canonicalizeServiceRequest( - query = """ - query Test(${'$'}id: ID!, ${'$'}include: Boolean!) { - node(id: ${'$'}id) { - ...Fields @include(if: ${'$'}include) - } - } - - fragment Fields on Node { - id - } - """.trimIndent(), - variables = linkedMapOf( - "id" to "ari:example:1", - "include" to true, - ), - ) - val actual = canonicalizeServiceRequest( - query = """ - fragment Fields on Node { - id - } - - query Test(${'$'}condition: Boolean!, ${'$'}identifier: ID!) { - node(id: ${'$'}identifier) { - ...Fields @include(if: ${'$'}condition) - } - } - """.trimIndent(), - variables = linkedMapOf( - "condition" to true, - "identifier" to "ari:example:1", - ), - ) - - assertEquals(expected, actual) - assertEquals(listOf("v0", "v1"), actual.variables.keys.toList()) - } - - @Test - fun `variable bindings still affect a service request`() { - val expected = canonicalizeServiceRequest( - query = """ - query Test(${'$'}first: String!, ${'$'}second: String!) { - echo(first: ${'$'}first, second: ${'$'}second) - } - """.trimIndent(), - variables = mapOf( - "first" to "one", - "second" to "two", - ), - ) - val actual = canonicalizeServiceRequest( - query = """ - query Test(${'$'}a: String!, ${'$'}b: String!) { - echo(first: ${'$'}b, second: ${'$'}a) - } - """.trimIndent(), - variables = mapOf( - "a" to "one", - "b" to "two", - ), - ) - - assertNotEquals(expected, actual) - } -} diff --git a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparator.kt b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparator.kt new file mode 100644 index 000000000..a275f80e3 --- /dev/null +++ b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparator.kt @@ -0,0 +1,132 @@ +package graphql.nadel.tests + +import graphql.language.AstPrinter +import graphql.language.AstSorter +import graphql.language.AstTransformer +import graphql.language.Document +import graphql.language.Node +import graphql.language.NodeTraverser +import graphql.language.NodeVisitorStub +import graphql.language.OperationDefinition +import graphql.language.VariableDefinition +import graphql.language.VariableReference +import graphql.nadel.engine.util.JsonMap +import graphql.util.TraversalControl +import graphql.util.TraverserContext +import graphql.util.TreeTransformerUtil.changeNode + +/** + * Compares service requests while allowing variables to be consistently renamed. + * + * Variable names are paired by their first use in the sorted queries. The same + * pairing is then applied to the actual query and its variables map before both + * are compared exactly. + */ +internal fun serviceRequestsMatchIgnoringVariableNames( + expectedDocument: Document, + expectedVariables: JsonMap, + actualDocument: Document, + actualVariables: JsonMap, +): Boolean { + val expected = prepareServiceRequest(expectedDocument, expectedVariables) + val actual = prepareServiceRequest(actualDocument, actualVariables) + + if (expected.variableNames.size != actual.variableNames.size) { + return false + } + + val actualToExpectedNames = actual.variableNames + .zip(expected.variableNames) + .toMap() + val renamedActualDocument = actual.document.renameVariables(actualToExpectedNames) + val renamedActualVariables = actual.variables + .mapKeys { (name, _) -> actualToExpectedNames.getValue(name) } + + return AstPrinter.printAstCompact(expected.document) == + AstPrinter.printAstCompact(AstSorter().sort(renamedActualDocument)) && + compareJsonObject( + expected = expected.variables, + actual = renamedActualVariables, + ).passed() +} + +private data class PreparedServiceRequest( + val document: Document, + val variableNames: List, + val variables: JsonMap, +) + +private fun prepareServiceRequest( + document: Document, + variables: JsonMap, +): PreparedServiceRequest { + val sortedDocument = AstSorter().sort(document) + val operation = sortedDocument.definitions + .filterIsInstance() + .single() + val definedVariableNames = operation.variableDefinitions + .map { it.name } + + require(definedVariableNames.distinct().size == definedVariableNames.size) { + "Service query contains duplicate variable definitions" + } + + val referencedVariableNames = linkedSetOf() + NodeTraverser().preOrder( + object : NodeVisitorStub() { + override fun visitVariableReference( + node: VariableReference, + context: TraverserContext>, + ): TraversalControl { + referencedVariableNames += node.name + return TraversalControl.CONTINUE + } + }, + sortedDocument, + ) + + val definedVariableNameSet = definedVariableNames.toSet() + require(referencedVariableNames == definedVariableNameSet) { + "Service query variable definitions and references must match" + } + require(variables.keys == definedVariableNameSet) { + "Service query variable definitions and variables map keys must match" + } + + return PreparedServiceRequest( + document = sortedDocument, + variableNames = referencedVariableNames.toList(), + variables = variables, + ) +} + +private fun Document.renameVariables(names: Map): Document { + return AstTransformer().transform( + this, + object : NodeVisitorStub() { + override fun visitVariableDefinition( + node: VariableDefinition, + context: TraverserContext>, + ): TraversalControl { + return changeNode( + context, + node.transform { builder -> + builder.name(names.getValue(node.name)) + }, + ) + } + + override fun visitVariableReference( + node: VariableReference, + context: TraverserContext>, + ): TraversalControl { + return changeNode( + context, + node.transform { builder -> + builder.name(names.getValue(node.name)) + }, + ) + } + }, + ) as Document +} diff --git a/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparatorTest.kt b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparatorTest.kt new file mode 100644 index 000000000..121a2d241 --- /dev/null +++ b/test/src/test/kotlin/graphql/nadel/tests/ServiceRequestComparatorTest.kt @@ -0,0 +1,101 @@ +package graphql.nadel.tests + +import graphql.parser.Parser +import kotlin.test.Test +import kotlin.test.assertFailsWith +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class ServiceRequestComparatorTest { + @Test + fun `variable names and definition order do not affect a service request`() { + val matches = serviceRequestsMatchIgnoringVariableNames( + expectedDocument = Parser().parseDocument( + """ + query Test(${'$'}id: ID!, ${'$'}include: Boolean!) { + node(id: ${'$'}id) { + id @include(if: ${'$'}include) + } + } + """.trimIndent(), + ), + expectedVariables = linkedMapOf( + "id" to "ari:example:1", + "include" to true, + ), + actualDocument = Parser().parseDocument( + """ + query Test(${'$'}condition: Boolean!, ${'$'}identifier: ID!) { + node(id: ${'$'}identifier) { + id @include(if: ${'$'}condition) + } + } + """.trimIndent(), + ), + actualVariables = linkedMapOf( + "condition" to true, + "identifier" to "ari:example:1", + ), + ) + + assertTrue(matches) + } + + @Test + fun `variable values must follow their query bindings`() { + val matches = serviceRequestsMatchIgnoringVariableNames( + expectedDocument = Parser().parseDocument( + """ + query Test(${'$'}first: String!, ${'$'}second: String!) { + echo(first: ${'$'}first, second: ${'$'}second) + } + """.trimIndent(), + ), + expectedVariables = mapOf( + "first" to "one", + "second" to "two", + ), + actualDocument = Parser().parseDocument( + """ + query Test(${'$'}a: String!, ${'$'}b: String!) { + echo(first: ${'$'}b, second: ${'$'}a) + } + """.trimIndent(), + ), + actualVariables = mapOf( + "a" to "one", + "b" to "two", + ), + ) + + assertFalse(matches) + } + + @Test + fun `variables map keys must match query variable names`() { + assertFailsWith { + serviceRequestsMatchIgnoringVariableNames( + expectedDocument = Parser().parseDocument( + """ + query Test(${'$'}id: ID!) { + node(id: ${'$'}id) { + id + } + } + """.trimIndent(), + ), + expectedVariables = mapOf("id" to "ari:example:1"), + actualDocument = Parser().parseDocument( + """ + query Test(${'$'}identifier: ID!) { + node(id: ${'$'}identifier) { + id + } + } + """.trimIndent(), + ), + actualVariables = mapOf("id" to "ari:example:1"), + ) + } + } +} diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt b/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt index 748db9e35..0888f5ab2 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/NadelIntegrationTest.kt @@ -22,13 +22,14 @@ import graphql.nadel.error.NadelGraphQLErrorException import graphql.nadel.instrumentation.NadelInstrumentation import graphql.nadel.instrumentation.parameters.NadelInstrumentationIsTimingEnabledParameters import graphql.nadel.tests.assertJsonObjectEquals -import graphql.nadel.tests.canonicalizeServiceRequest import graphql.nadel.tests.compareJsonObject import graphql.nadel.tests.jsonObjectMapper +import graphql.nadel.tests.serviceRequestsMatchIgnoringVariableNames import graphql.nadel.tests.withPrettierPrinter import graphql.nadel.validation.NadelSchemaValidation import graphql.nadel.validation.NadelSchemaValidationError import graphql.nadel.validation.NadelSchemaValidationFactory +import graphql.parser.Parser import graphql.schema.idl.RuntimeWiring import graphql.schema.idl.SchemaGenerator import graphql.schema.idl.SchemaParser @@ -325,6 +326,8 @@ abstract class NadelIntegrationTest( } private fun assertServiceCalls(testSnapshot: TestSnapshot) { + val documentParser = Parser() + fun isDelayedResultsEqual( expectedCall: ExpectedServiceCall, actualCall: TestExecutionCapture.Call, @@ -347,23 +350,17 @@ abstract class NadelIntegrationTest( expected = testSnapshot.calls, actual = executionCapture.calls ) { expectedCall, actualCall -> - val expectedRequest = canonicalizeServiceRequest( - query = expectedCall.query, - variables = expectedCall.variables, - ) - val actualRequest = canonicalizeServiceRequest( - query = actualCall.query, - variables = actualCall.variables, - ) + val actualVariables = actualCall.variables val actualResult = actualCall.result actualCall.service == expectedCall.service && expectedCall.delayedResults.size == actualCall.delayedResults.size - && expectedRequest.query == actualRequest.query - && compareJsonObject( - expected = expectedRequest.variables, - actual = actualRequest.variables, - ).passed() + && serviceRequestsMatchIgnoringVariableNames( + expectedDocument = documentParser.parseDocument(expectedCall.query), + expectedVariables = expectedCall.variables, + actualDocument = documentParser.parseDocument(actualCall.query), + actualVariables = actualVariables, + ) && compareJsonObject(expected = expectedCall.result, actual = actualResult).passed() && isDelayedResultsEqual(expectedCall, actualCall) } diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt b/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt index adff84f42..aea7d72b3 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/TestExecutionCapture.kt @@ -5,10 +5,12 @@ import graphql.ExecutionResult import graphql.incremental.DelayedIncrementalPartialResult import graphql.incremental.IncrementalExecutionResult import graphql.incremental.IncrementalExecutionResultImpl +import graphql.language.AstPrinter +import graphql.language.AstSorter import graphql.nadel.NadelExecutionInput import graphql.nadel.engine.util.JsonMap -import graphql.nadel.tests.canonicalizeServiceRequest import graphql.nadel.tests.jsonObjectMapper +import graphql.parser.Parser import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.reactive.asFlow import kotlinx.coroutines.reactive.asPublisher @@ -45,16 +47,17 @@ class TestExecutionCapture { ): ExecutionResult { val delayedResults = synchronizedMutableListOf() - val canonicalRequest = canonicalizeServiceRequest( - query = query, - variables = variables, + val canonicalQuery = AstPrinter.printAst( + AstSorter().sort( + Parser().parseDocument(query) + ), ) _calls.add( Call( service = service, - query = canonicalRequest.query, - variables = canonicalRequest.variables, + query = canonicalQuery, + variables = variables, result = deepClone(result), delayedResults = delayedResults, ), From 695b9a42f127cf0c42fd5f0acb4cc47b411892eb Mon Sep 17 00:00:00 2001 From: Artyom Emelyanenko Date: Mon, 27 Jul 2026 21:15:42 +1000 Subject: [PATCH 3/5] Normalize hydration arguments at backing field boundary --- .../hydration/NadelHydrationFieldsBuilder.kt | 10 +++++++++- .../transform/hydration/NadelHydrationInputBuilder.kt | 11 ++--------- .../batch/NadelBatchHydrationInputBuilder.kt | 5 +---- ...ith argument value from original field argument.kt | 3 ++- ...th-argument-value-from-original-field-argument.yml | 3 ++- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt index 47a37568f..01ca70900 100644 --- a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt +++ b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt @@ -19,6 +19,7 @@ import graphql.nadel.engine.util.toBuilder import graphql.nadel.engine.util.unwrapAll import graphql.normalized.ExecutableNormalizedField import graphql.normalized.NormalizedInputValue +import graphql.schema.GraphQLTypeUtil internal object NadelHydrationFieldsBuilder { fun makeBackingQueries( @@ -198,7 +199,14 @@ internal object NadelHydrationFieldsBuilder { schema = executionBlueprint.engineSchema, parentType = executionBlueprint.engineSchema.queryType, queryPathToField = instruction.queryPathToBackingField, - fieldArguments = fieldArguments, + // Values forwarded from hydration arguments retain their source types. + // Backing queries must declare variables using the backing argument types. + fieldArguments = fieldArguments.mapValues { (argumentName, value) -> + NormalizedInputValue( + GraphQLTypeUtil.simplePrint(instruction.backingFieldDef.getArgument(argumentName).type), + value.value, + ) + }, fieldChildren = fieldChildren, ) } diff --git a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt index 68410297a..e17fdbeb8 100644 --- a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt +++ b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt @@ -124,7 +124,7 @@ internal class NadelHydrationInputBuilder private constructor( inputDef: NadelHydrationArgument, ): NormalizedInputValue? { return when (val valueSource = inputDef.valueSource) { - is ValueSource.ArgumentValue -> getArgumentValue(inputDef, valueSource) + is ValueSource.ArgumentValue -> getArgumentValue(valueSource) is ValueSource.FieldResultValue -> makeInputValue( inputDef, value = getResultValue(valueSource), @@ -162,16 +162,9 @@ internal class NadelHydrationInputBuilder private constructor( } private fun getArgumentValue( - inputDef: NadelHydrationArgument, valueSource: ValueSource.ArgumentValue, ): NormalizedInputValue? { - val argumentValue = virtualField.getNormalizedArgument(valueSource.argumentName) ?: valueSource.defaultValue - return argumentValue?.let { - NormalizedInputValue( - GraphQLTypeUtil.simplePrint(inputDef.backingArgumentDef.type), - it.value, - ) - } + return virtualField.getNormalizedArgument(valueSource.argumentName) ?: valueSource.defaultValue } private fun getResultValue( diff --git a/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt b/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt index 4cbc206fc..9e1c563ce 100644 --- a/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt +++ b/lib/src/main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt @@ -30,10 +30,7 @@ internal object NadelBatchHydrationInputBuilder { virtualField.normalizedArguments[valueSource.argumentName] ?: valueSource.defaultValue if (argValue != null) { - argument to NormalizedInputValue( - GraphQLTypeUtil.simplePrint(argument.backingArgumentDef.type), - argValue.value, - ) + argument to argValue } else { null } diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt index 4ea440584..f98611db7 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt @@ -59,7 +59,8 @@ class `hydration call with argument value from original field argument` : NadelL } type Issue { id: ID - author(extraArg: String): User @hydrated( + # The backing argument is String; this verifies batch passthrough arguments use the backing type. + author(extraArg: ID!): User @hydrated( service: "UserService" field: "usersByIds" arguments: [ diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml index 4341efaf9..6c92fa39f 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml @@ -16,7 +16,8 @@ overallSchema: } type Issue { id: ID - author(extraArg: String): User @hydrated( + # The backing argument is String; this verifies batch passthrough arguments use the backing type. + author(extraArg: ID!): User @hydrated( service: "UserService" field: "usersByIds" arguments: [ From 4f5363508aa95401f23cbbecb709e7a428376397 Mon Sep 17 00:00:00 2001 From: Artyom Emelyanenko Date: Mon, 27 Jul 2026 21:26:00 +1000 Subject: [PATCH 4/5] Remove hydration changes from hint cleanup --- .../transform/hydration/NadelHydrationFieldsBuilder.kt | 10 +--------- ...with argument value from original field argument.kt | 3 +-- .../statics/StaticHydrationScalarFieldTest.kt | 2 +- ...ith-argument-value-from-original-field-argument.yml | 3 +-- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt index 01ca70900..47a37568f 100644 --- a/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt +++ b/lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationFieldsBuilder.kt @@ -19,7 +19,6 @@ import graphql.nadel.engine.util.toBuilder import graphql.nadel.engine.util.unwrapAll import graphql.normalized.ExecutableNormalizedField import graphql.normalized.NormalizedInputValue -import graphql.schema.GraphQLTypeUtil internal object NadelHydrationFieldsBuilder { fun makeBackingQueries( @@ -199,14 +198,7 @@ internal object NadelHydrationFieldsBuilder { schema = executionBlueprint.engineSchema, parentType = executionBlueprint.engineSchema.queryType, queryPathToField = instruction.queryPathToBackingField, - // Values forwarded from hydration arguments retain their source types. - // Backing queries must declare variables using the backing argument types. - fieldArguments = fieldArguments.mapValues { (argumentName, value) -> - NormalizedInputValue( - GraphQLTypeUtil.simplePrint(instruction.backingFieldDef.getArgument(argumentName).type), - value.value, - ) - }, + fieldArguments = fieldArguments, fieldChildren = fieldChildren, ) } diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt index f98611db7..4ea440584 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/new hydration/hydration call with argument value from original field argument.kt @@ -59,8 +59,7 @@ class `hydration call with argument value from original field argument` : NadelL } type Issue { id: ID - # The backing argument is String; this verifies batch passthrough arguments use the backing type. - author(extraArg: ID!): User @hydrated( + author(extraArg: String): User @hydrated( service: "UserService" field: "usersByIds" arguments: [ diff --git a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTest.kt b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTest.kt index e69df66fe..63093eb14 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTest.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/next/fixtures/hydration/statics/StaticHydrationScalarFieldTest.kt @@ -37,7 +37,7 @@ class StaticHydrationScalarFieldTest : NadelIntegrationTest( overallSchema = """ type Query { copyField( - id: ID! + id: String ): String @hydrated( service: "graph_store", diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml index 6c92fa39f..4341efaf9 100644 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml +++ b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml @@ -16,8 +16,7 @@ overallSchema: } type Issue { id: ID - # The backing argument is String; this verifies batch passthrough arguments use the backing type. - author(extraArg: ID!): User @hydrated( + author(extraArg: String): User @hydrated( service: "UserService" field: "usersByIds" arguments: [ From 6d33f8c370e74d62353b59323705c5b7d7060bc8 Mon Sep 17 00:00:00 2001 From: Artyom Emelyanenko Date: Tue, 28 Jul 2026 17:40:00 +1000 Subject: [PATCH 5/5] Drop affected legacy variable fixtures --- .../graphql/nadel/tests/EngineTestHook.kt | 23 +- ...tching-of-hydration-list-with-partition.kt | 7 - .../graphqlcontext-is-present-on-input.kt | 26 +- .../hooks/polymorphic-hydration-hooks.kt | 3 - ...qlcontext is present on input snapshot.kt} | 4 +- ... => graphqlcontext is present on input.kt} | 2 +- ...ll-with-variables-inside-input-objects.yml | 53 --- ...ri-argument-transform-on-renamed-field.yml | 62 --- .../ari use case/ari-argument-transform.yml | 62 --- ...ame-inside-batch-hydration-null-object.yml | 152 ------- .../deep-rename-inside-batch-hydration.yml | 160 ------- .../deep-rename-inside-hydration.yml | 117 ------ .../deep-rename-inside-hydrations.yml | 191 --------- .../deep-rename-with-argument-works.yml | 70 ---- ...ents-with-mixed-literals-and-variables.yml | 77 ---- ...named-field-input-is-wrapped-in-a-list.yml | 93 ----- ...lined-all-arguments-with-renamed-field.yml | 93 ----- .../inlined-json-arguments.yml | 57 --- .../input-object-with-json-field.yml | 59 --- .../primitive-json-arguments-variables.yml | 59 --- .../primitive-json-arguments.yml | 57 --- ...e-resolution-handles-complex-fragments.yml | 138 ------- ...nline-fragments-from-multiple-services.yml | 109 ----- ...services-with-one-unmapped-node-lookup.yml | 119 ------ ...c-service-resolution-multiple-services.yml | 134 ------ ...service-resolution-simple-success-case.yml | 83 ---- ...c-service-resolution-with-no-fragments.yml | 93 ----- ...ueries-using-dynamic-resolved-services.yml | 87 ---- ...vice-is-possible-with-synthetic-fields.yml | 167 -------- ...types-from-another-service-is-possible.yml | 156 ------- ...s-via-hydration-returning-a-connection.yml | 205 --------- ...via-hydration-with-arguments-passed-on.yml | 118 ------ ...via-hydration-with-variables-arguments.yml | 122 ------ ...d-hydration-top-level-field-is-removed.yml | 109 ----- .../hydration-top-level-field-is-removed.yml | 98 ----- ...d-hydration-top-level-field-is-removed.yml | 105 ----- ...s-not-removed-short-circuit-hint-is-on.yml | 60 --- .../graphqlcontext-is-present-on-input.yml | 58 --- .../introspection-with-variables.yml | 66 --- .../java-compat/java-ari-transform.yml | 62 --- ...and-use-same-field-as-hydration-source.yml | 134 ------ ...he-result-are-backed-a-batch-hydration.yml | 176 -------- ...s-in-the-result-are-backed-a-hydration.yml | 187 --------- ...he-result-are-backed-a-batch-hydration.yml | 176 -------- ...s-in-the-result-are-backed-a-hydration.yml | 187 --------- ...dration-fields-are-seen-by-transformer.yml | 125 ------ ...l-hydration-with-true-equals-condition.yml | 123 ------ ...-hydration-with-true-matches-condition.yml | 123 ------ ...ration-with-true-starts-with-condition.yml | 123 ------ .../basic-hydration-directive-based.yml | 123 ------ ...asic-hydration-with-actor-field-rename.yml | 121 ------ ...ion-with-default-array-argument-values.yml | 116 ------ ...n-with-default-boolean-argument-values.yml | 116 ------ ...ation-with-default-int-argument-values.yml | 116 ------ ...tion-with-default-null-argument-values.yml | 116 ------ ...on-with-default-object-argument-values.yml | 131 ------ ...on-with-default-string-argument-values.yml | 116 ------ .../basic-hydration-with-static-arg-array.yml | 113 ----- ...asic-hydration-with-static-arg-boolean.yml | 110 ----- .../basic-hydration-with-static-arg-float.yml | 110 ----- ...asic-hydration-with-static-arg-integer.yml | 108 ----- ...hydration-with-static-arg-object-array.yml | 137 ------ ...basic-hydration-with-static-arg-object.yml | 128 ------ .../basic-hydration-with-static-args.yml | 108 ----- .../new hydration/basic-hydration.yml | 121 ------ ...ydration-instruction-hook-returns-null.yml | 139 ------- .../batch-hydration-null-source-object.yml | 127 ------ ...tch-hydration-with-renamed-actor-field.yml | 135 ------ ...hydration-query-with-a-synthetic-field.yml | 223 ---------- ...ion-with-default-array-argument-values.yml | 210 ---------- ...n-with-default-boolean-argument-values.yml | 210 ---------- ...ation-with-default-int-argument-values.yml | 210 ---------- ...tion-with-default-null-argument-values.yml | 210 ---------- ...on-with-default-object-argument-values.yml | 224 ---------- ...on-with-default-string-argument-values.yml | 210 ---------- ...ydration-list-with-flattened-arguments.yml | 223 ---------- ...ing-of-hydration-list-with-partition-2.yml | 186 --------- ...ching-of-hydration-list-with-partition.yml | 224 ---------- .../batching-of-hydration-list.yml | 204 --------- .../batching/batching-absent-source-input.yml | 215 ---------- ...true-condition-after-a-false-condition.yml | 155 ------- ...conditional-hydration-in-abstract-type.yml | 315 -------------- ...al-hydration-with-list-condition-field.yml | 119 ------ ...h-multiple-true-conditions-takes-first.yml | 155 ------- ...ditional-hydration-works-with-int-type.yml | 119 ------ ...hydration-works-with-matches-condition.yml | 155 ------- ...ation-works-with-starts-with-condition.yml | 155 ------- ...source-ids-going-to-different-services.yml | 300 -------------- .../batching/batching-no-source-inputs.yml | 248 ----------- .../batching/batching-single-source-id.yml | 237 ----------- ...n-batch-hydration-for-specific-service.yml | 136 ------ ...gacy-operation-name-on-batch-hydration.yml | 137 ------ ...ate-legacy-operation-name-on-hydration.yml | 123 ------ ...ds-in-the-input-identified-by-argument.yml | 229 ---------- ...-hydration-batching-returns-null-batch.yml | 112 ----- ...rce-for-2-hydrations-and-a-deep-rename.yml | 271 ------------ ...d-by-uses-same-source-for-2-hydrations.yml | 250 ----------- ...x-identified-by-with-indexed-hydration.yml | 222 ---------- ...plex-identified-by-with-list-source-id.yml | 275 ------------ .../complex-identified-by-with-rename.yml | 301 -------------- ...dentified-by-with-some-null-source-ids.yml | 247 ----------- .../complex-identified-by.yml | 297 ------------- ...ex-input-object-with-indexed-hydration.yml | 222 ---------- ...uals-predicate-works-with-integer-type.yml | 144 ------- ...n-matches-predicate-works-with-id-type.yml | 144 ------- ...arts-with-predicate-works-with-id-type.yml | 144 ------- ...ive-field-argument-passed-to-hydration.yml | 200 --------- ...argument-passed-to-synthetic-hydration.yml | 203 --------- .../hydration-batching-returns-null.yml | 112 ----- .../hydration-call-forwards-error.yml | 137 ------ ...on-call-over-itself-with-renamed-types.yml | 195 --------- ...ent-value-from-original-field-argument.yml | 126 ------ ...-the-hydrated-part-and-synthetic-field.yml | 223 ---------- ...ll-with-fragments-in-the-hydrated-part.yml | 205 --------- ...t-values-from-original-field-arguments.yml | 127 ------ ...om-field-in-interface-with-type-rename.yml | 129 ------ .../hydration-from-field-in-interface.yml | 129 ------ .../hydration-inside-a-renamed-field.yml | 112 ----- .../new hydration/hydration-list-input.yml | 172 -------- ...tion-list-with-batching-forwards-error.yml | 127 ------ .../hydration-list-with-batching.yml | 135 ------ .../hydration-list-with-one-element.yml | 118 ------ ...ration-with-interfaces-asking-typename.yml | 126 ------ .../hydration-with-interfaces.yml | 119 ------ .../hydration-with-more-interfaces.yml | 165 -------- ...le-conditions-ignores-false-conditions.yml | 144 ------- ...h-multiple-true-conditions-takes-first.yml | 144 ------- ...ration-within-hydration-with-variables.yml | 167 -------- ...hen-an-ancestor-field-has-been-renamed.yml | 120 ------ .../index-hydration-all-null-ids.yml | 99 ----- ...ndex-hydration-with-partitioned-inputs.yml | 213 ---------- ...g-using-index-one-batch-returns-errors.yml | 192 --------- ...g-index-result-size-invariant-mismatch.yml | 125 ------ ...-matching-using-index-returning-errors.yml | 137 ------ ...ng-using-index-returning-null-elements.yml | 145 ------- ...on-matching-using-index-returning-null.yml | 135 ------ ...lists-with-hydration-field-not-exposed.yml | 155 ------- ...ration-matching-using-index-with-lists.yml | 149 ------- ...hing-using-index-with-null-input-nodes.yml | 150 ------- .../index/hydration-matching-using-index.yml | 148 ------- ...ydrations-with-different-source-fields.yml | 165 -------- ...ration-under-a-renamed-top-level-field.yml | 212 ---------- ...atched-with-null-value-in-source-array.yml | 138 ------- ...able-argument-for-hydration-is-missing.yml | 165 -------- ...-hydration-call-with-fragments-defined.yml | 129 ------ ...ll-with-input-value-having-longer-path.yml | 125 ------ ...nger-path-and-same-named-overall-field.yml | 173 -------- ...onger-path-arguments-and-merged-fields.yml | 153 ------- ...-hydration-call-with-variables-defined.yml | 125 ------ ...nger-path-and-same-named-overall-field.yml | 184 --------- ...nts-and-merged-fields-and-renamed-type.yml | 164 -------- ...-return-types-implement-same-interface.yml | 265 ------------ ...n-actor-fields-are-in-the-same-service.yml | 257 ------------ ...ration-return-null-in-array-with-error.yml | 268 ------------ ...morphic-hydration-return-null-in-array.yml | 254 ------------ ...ration-return-top-level-null-and-error.yml | 254 ------------ ...orphic-hydration-return-top-level-null.yml | 240 ----------- ...hic-hydration-when-hook-returns-null-1.yml | 253 ------------ ...rphic-hydration-when-hook-returns-null.yml | 217 ---------- ...dration-where-only-one-type-is-queried.yml | 253 ------------ ...-polymorphic-hydration-with-conditions.yml | 271 ------------ ...-polymorphic-hydration-with-interfaces.yml | 310 -------------- ...morphic-hydration-with-lots-of-renames.yml | 272 ------------ ...atch-polymorphic-hydration-with-rename.yml | 266 ------------ ...atch-polymorphic-hydration-with-unions.yml | 308 -------------- .../batch-polymorphic-hydration.yml | 263 ------------ ...ic-hydrations-are-executed-in-parallel.yml | 259 ------------ ...tion-instructions-use-different-inputs.yml | 279 ------------- ...rphic-hydration-when-hook-returns-null.yml | 185 --------- .../solitary-polymorphic-hydration.yml | 217 ---------- ...h-hydrated-interfaces-work-as-expected.yml | 298 ------------- ...ith-errors-are-reflected-in-the-result.yml | 136 ------ ...ith-errors-are-reflected-in-the-result.yml | 147 ------- ...ns-and-simple-data-and-lots-of-renames.yml | 326 --------------- ...hree-nested-hydrations-and-simple-data.yml | 198 --------- ...nested-hydrations-and-synthetic-fields.yml | 275 ------------ .../query-with-three-nested-hydrations.yml | 252 ----------- ...ted-query-using-same-underlying-source.yml | 124 ------ ...-level-overlapping-fields-in-the-query.yml | 117 ------ ...-same-level-when-using-batch-hydration.yml | 114 ----- ...ated-hydrated-fields-on-the-same-level.yml | 110 ----- .../same-source-for-2-hydrations.yml | 151 ------- ...e-for-2-nested-hydrations-and-a-rename.yml | 170 -------- ...hydration-query-with-a-synthetic-field.yml | 121 ------ ...ion-with-one-service-and-type-renaming.yml | 154 ------- ...thetic-hydration-batching-returns-null.yml | 122 ------ ...-call-over-itself-within-renamed-types.yml | 211 ---------- ...t-values-from-original-field-arguments.yml | 138 ------- .../synthetic-hydration-forwards-error.yml | 127 ------ ...tion-list-with-batching-forwards-error.yml | 136 ------ .../synthetic-hydration-with-renamed-type.yml | 123 ------ ...hen-an-ancestor-field-has-been-renamed.yml | 133 ------ ...ns-null-in-batched-synthetic-hydration.yml | 191 --------- ...ta-returns-null-in-synthetic-hydration.yml | 117 ------ ...is-null-in-batched-synthetic-hydration.yml | 182 -------- ...l-field-is-null-in-synthetic-hydration.yml | 117 ------ .../transformer-on-hydration-fields.yml | 110 ----- .../fixtures/oneOf/one-of-successful.yml | 54 --- ...el-interface-fields-get-typename-added.yml | 204 --------- ...s-which-are-renamed-get-typename-added.yml | 214 ---------- ...have-typename-in-them-work-as-expected.yml | 239 ----------- ...typename-in-fragments-work-as-expected.yml | 212 ---------- ...ixed-typename-in-them-work-as-expected.yml | 247 ----------- ...typename-in-fragments-work-as-expected.yml | 257 ------------ ...have-typename-in-them-work-as-expected.yml | 250 ----------- ...hain-rename-transform-with-type-rename.yml | 92 ----- .../renames/chain-rename-transform.yml | 93 ----- .../renames/rename-inside-hydration.yml | 125 ------ .../rename-inside-multiple-hydrations.yml | 158 ------- .../rename-on-shared-abstract-type.yml | 89 ---- .../renamed-top-level-field-with-argument.yml | 60 --- .../renamed-type-inside-batch-hydration.yml | 175 -------- ...e-inside-deep-rename-that-returns-null.yml | 93 ----- .../types/renamed-type-inside-deep-rename.yml | 115 ------ ...ype-inside-hydration-that-returns-null.yml | 118 ------ .../types/renamed-type-inside-hydration.yml | 128 ------ .../repeated-fragments-with-renamed-types.yml | 390 ------------------ ...d-input-types-rename-works-as-expected.yml | 134 ------ .../calls-to-multiple-services-are-merged.yml | 125 ------ .../date-time-scalar-as-input-type.yml | 61 --- .../fixtures/scalars/hydrating-json-data.yml | 107 ----- .../hydrating-using-date-time-as-arg.yml | 96 ----- .../scalars/hydrating-using-long-as-arg.yml | 96 ----- .../scalars/hydrating-using-url-as-arg.yml | 119 ------ ...ng-scalar-argument-with-default-values.yml | 45 -- .../scalars/long-scalar-as-input-type.yml | 61 --- .../scalars/url-scalar-as-input-type.yml | 61 --- ...e-directive-field-with-hydrated-parent.yml | 94 ----- ...ve-on-field-with-batch-hydrated-parent.yml | 118 ------ 229 files changed, 27 insertions(+), 35432 deletions(-) rename test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/{graphqlcontextispresentoninput snapshot.kt => graphqlcontext is present on input snapshot.kt} (91%) rename test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/{graphqlcontextispresentoninput.kt => graphqlcontext is present on input.kt} (94%) delete mode 100644 test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml delete mode 100644 test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml delete mode 100644 test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml delete mode 100644 test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml delete mode 100644 test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml delete mode 100644 test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml delete mode 100644 test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml delete mode 100644 test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml delete mode 100644 test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml delete mode 100644 test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml delete mode 100644 test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml delete mode 100644 test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml delete mode 100644 test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml delete mode 100644 test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml delete mode 100644 test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml delete mode 100644 test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml delete mode 100644 test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml delete mode 100644 test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml delete mode 100644 test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml delete mode 100644 test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml delete mode 100644 test/src/test/resources/fixtures/introspection/introspection-with-variables.yml delete mode 100644 test/src/test/resources/fixtures/java-compat/java-ari-transform.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/basic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-list-input.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml delete mode 100644 test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml delete mode 100644 test/src/test/resources/fixtures/oneOf/one-of-successful.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml delete mode 100644 test/src/test/resources/fixtures/renames/chain-rename-transform.yml delete mode 100644 test/src/test/resources/fixtures/renames/rename-inside-hydration.yml delete mode 100644 test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml delete mode 100644 test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml delete mode 100644 test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml delete mode 100644 test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml delete mode 100644 test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml delete mode 100644 test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml delete mode 100644 test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml delete mode 100644 test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml delete mode 100644 test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml delete mode 100644 test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml delete mode 100644 test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml delete mode 100644 test/src/test/resources/fixtures/scalars/hydrating-json-data.yml delete mode 100644 test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml delete mode 100644 test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml delete mode 100644 test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml delete mode 100644 test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml delete mode 100644 test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml delete mode 100644 test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml delete mode 100644 test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml delete mode 100644 test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml diff --git a/test/src/test/kotlin/graphql/nadel/tests/EngineTestHook.kt b/test/src/test/kotlin/graphql/nadel/tests/EngineTestHook.kt index e5d40cd3c..b74e146cc 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/EngineTestHook.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/EngineTestHook.kt @@ -8,6 +8,7 @@ import graphql.nadel.ServiceExecution import graphql.nadel.engine.transform.NadelTransform import graphql.nadel.schema.NeverWiringFactory import graphql.nadel.schema.SchemaTransformationHook +import graphql.nadel.tests.legacy.NadelLegacyIntegrationTest import graphql.nadel.tests.util.join import graphql.nadel.tests.util.toSlug import graphql.nadel.validation.NadelSchemaValidationError @@ -129,20 +130,26 @@ private object Util { // TODO: provide single source of truth for this logic - duplicated in EngineTests @Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") - val allFixtureFileNames = File(javaClass.classLoader.getResource("fixtures").path) + val allTestNames = File(javaClass.classLoader.getResource("fixtures").path) .walkTopDown() .filter { it.extension == "yml" || it.extension == "yaml" } .map { it.nameWithoutExtension } .toHashSet() + .apply { + Reflections(NadelLegacyIntegrationTest::class.java.packageName) + .getSubTypesOf(NadelLegacyIntegrationTest::class.java) + .mapTo(this) { it.simpleName.toSlug() } + } - hookImpls + val hooksWithoutTests = hookImpls .filter { it.isAnnotationPresent(UseHook::class.java) } - .forEach { hookImpl -> - val fixtureName = hookImpl.simpleName - if (fixtureName !in allFixtureFileNames) { - error("Unable to find matching test for hook: $fixtureName") - } - } + .map { it.simpleName } + .filterNot { it in allTestNames } + .sorted() + + check(hooksWithoutTests.isEmpty()) { + "Unable to find matching tests for hooks: ${hooksWithoutTests.joinToString()}" + } return true } diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/batching-of-hydration-list-with-partition.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/batching-of-hydration-list-with-partition.kt index 1c3d8100a..800c70e30 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/batching-of-hydration-list-with-partition.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/batching-of-hydration-list-with-partition.kt @@ -42,13 +42,6 @@ class `batching-of-hydration-list-with-partition` : EngineTestHook { } } -@UseHook -class `batching-of-hydration-list-with-partition-2` : EngineTestHook { - override fun makeNadel(builder: Nadel.Builder): Nadel.Builder { - return builder.executionHooks(BatchHydrationHooks()) - } -} - @UseHook class `index-hydration-with-partitioned-inputs` : EngineTestHook { override fun makeNadel( diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/graphqlcontext-is-present-on-input.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/graphqlcontext-is-present-on-input.kt index a7097b00e..1a14bd92f 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/graphqlcontext-is-present-on-input.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/graphqlcontext-is-present-on-input.kt @@ -1,13 +1,10 @@ package graphql.nadel.tests.hooks import graphql.ExecutionResult -import graphql.nadel.Nadel import graphql.nadel.NadelExecutionInput import graphql.nadel.ServiceExecution -import graphql.nadel.ServiceExecutionFactory import graphql.nadel.tests.EngineTestHook import graphql.nadel.tests.UseHook -import graphql.nadel.tests.util.serviceExecutionFactory import strikt.api.expectThat import strikt.assertions.isEqualTo import strikt.assertions.isGreaterThan @@ -20,20 +17,15 @@ class `graphqlcontext-is-present-on-input` : EngineTestHook { return builder.graphqlContext("x", "y") } - override fun makeNadel(builder: Nadel.Builder): Nadel.Builder { - val serviceExecutionFactory = builder.serviceExecutionFactory - - return builder - .serviceExecutionFactory(object : ServiceExecutionFactory by serviceExecutionFactory { - override fun getServiceExecution(serviceName: String): ServiceExecution { - val serviceExecution = serviceExecutionFactory.getServiceExecution(serviceName) - return ServiceExecution { params -> - calls++ - expectThat(params.graphQLContext.get("x") as String).isEqualTo("y") - serviceExecution.execute(params) - } - } - }) + override fun wrapServiceExecution( + serviceName: String, + baseTestServiceExecution: ServiceExecution, + ): ServiceExecution { + return ServiceExecution { params -> + calls++ + expectThat(params.graphQLContext.get("x") as String).isEqualTo("y") + baseTestServiceExecution.execute(params) + } } override fun assertResult(result: ExecutionResult) { diff --git a/test/src/test/kotlin/graphql/nadel/tests/hooks/polymorphic-hydration-hooks.kt b/test/src/test/kotlin/graphql/nadel/tests/hooks/polymorphic-hydration-hooks.kt index 263376597..70a0e18a2 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/hooks/polymorphic-hydration-hooks.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/hooks/polymorphic-hydration-hooks.kt @@ -59,9 +59,6 @@ class `batch-polymorphic-hydration-where-only-one-type-is-queried` : Polymorphic @UseHook class `batch-polymorphic-hydration-when-hook-returns-null` : PolymorphicHydrationTestHook() -@UseHook -class `batch-polymorphic-hydration-when-hook-returns-null-1` : PolymorphicHydrationTestHook() - @UseHook class `solitary-polymorphic-hydration-when-hook-returns-null` : PolymorphicHydrationTestHook() diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontext is present on input snapshot.kt similarity index 91% rename from test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt rename to test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontext is present on input snapshot.kt index e1ebb32fa..0523e35fa 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput snapshot.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontext is present on input snapshot.kt @@ -10,7 +10,7 @@ import kotlin.collections.List import kotlin.collections.listOf private suspend fun main() { - graphql.nadel.tests.next.update() + graphql.nadel.tests.next.update<`graphqlcontext is present on input`>() } /** @@ -19,7 +19,7 @@ private suspend fun main() { * Refer to [graphql.nadel.tests.next.UpdateTestSnapshots */ @Suppress("unused") -public class `graphqlcontextispresentoninput snapshot` : TestSnapshot() { +public class `graphqlcontext is present on input snapshot` : TestSnapshot() { override val calls: List = listOf( ExpectedServiceCall( service = "MyService", diff --git a/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput.kt b/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontext is present on input.kt similarity index 94% rename from test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput.kt rename to test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontext is present on input.kt index ea976f2bf..ac46c3742 100644 --- a/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontextispresentoninput.kt +++ b/test/src/test/kotlin/graphql/nadel/tests/legacy/graphqlcontext/graphqlcontext is present on input.kt @@ -2,7 +2,7 @@ package graphql.nadel.tests.legacy.graphqlcontext import graphql.nadel.tests.legacy.NadelLegacyIntegrationTest -class graphqlcontextispresentoninput : NadelLegacyIntegrationTest( +class `graphqlcontext is present on input` : NadelLegacyIntegrationTest( query = """ query { hello(arg: "x") { diff --git a/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml b/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml deleted file mode 100644 index 53b6713ee..000000000 --- a/test/src/test/resources/fixtures/basic/call-with-variables-inside-input-objects.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: "call with variables inside input objects" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: Arg, otherArg: String): String - } - input Arg { - ids: [ID] - } -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - hello(arg: Arg, otherArg: String): String - } - - input Arg { - ids: [ID] - } -# language=GraphQL -query: | - query myQuery($varIds: [ID], $otherVar: String) { - hello(arg: {ids: $varIds}, otherArg: $otherVar) - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: Arg) { - hello(arg: $v0) - } - variables: {"v0":{}} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml b/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml deleted file mode 100644 index 8de0b5208..000000000 --- a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform-on-renamed-field.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "ari argument transform on renamed field" -enabled: true -# language=GraphQL -overallSchema: - service: | - directive @interpretAri on ARGUMENT_DEFINITION - type Query { - issue(id: ID @interpretAri): Issue @renamed(from: "issueById") - } - type Issue { - key: ID @renamed(from: "id") - } -# language=GraphQL -underlyingSchema: - service: | - type Query { - issueById(id: ID): Issue - } - type Issue { - id: ID - } -# language=GraphQL -query: | - query { - issue(id: "ari:/i-forget-what-aris-actually-look-like/57") { - key - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: ID) { - rename__issue__issueById: issueById(id: $v0) { - __typename__rename__key: __typename - rename__key__id: id - } - } - variables: {"v0":"57"} - # language=JSON - response: |- - { - "data": { - "rename__issue__issueById": { - "__typename__rename__key": "Issue", - "rename__key__id": "57" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "key": "57" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml b/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml deleted file mode 100644 index a15e87f86..000000000 --- a/test/src/test/resources/fixtures/chained transforms/ari use case/ari-argument-transform.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "ari argument transform" -enabled: true -# language=GraphQL -overallSchema: - service: | - directive @interpretAri on ARGUMENT_DEFINITION - type Query { - issue(id: ID @interpretAri): Issue - } - type Issue { - key: ID @renamed(from: "id") - } -# language=GraphQL -underlyingSchema: - service: | - type Query { - issue(id: ID): Issue - } - type Issue { - id: ID - } -# language=GraphQL -query: | - query { - issue(id: "ari:/i-forget-what-aris-actually-look-like/57") { - key - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(id: $v0) { - __typename__rename__key: __typename - rename__key__id: id - } - } - variables: {"v0":"57"} - # language=JSON - response: |- - { - "data": { - "issue": { - "__typename__rename__key": "Issue", - "rename__key__id": "57" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "key": "57" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml deleted file mode 100644 index ce35222cc..000000000 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration-null-object.yml +++ /dev/null @@ -1,152 +0,0 @@ -name: "deep rename inside batch hydration null object" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issuesByIds(id: [ID!]): [Issue] - } - type Issue { - name: String @renamed(from: "detail.detailName") - } - UserService: | - type Query { - users: [User] - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issuesByIds" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - detail: IssueDetails - } - - type IssueDetails { - detailName: String - } - - type Query { - issuesByIds(id: [ID!]): [Issue] - } - UserService: | - type Query { - users: [User] - } - - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - users { - issue { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - users { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-1" - }, - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-2" - }, - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-3" - } - ] - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: [ID!]) { - issuesByIds(id: $v0) { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName - } - batch_hydration__issue__id: id - } - } - variables: {"v0":["issue-1","issue-2","issue-3"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "batch_hydration__issue__id": "issue-1", - "deep_rename__name__detail": { - "detailName": "Memes are the DNA of the soul" - }, - "__typename__deep_rename__name": "Issue" - }, - { - "batch_hydration__issue__id": "issue-3", - "deep_rename__name__detail": { - "detailName": "Names are arbitrary" - }, - "__typename__deep_rename__name": "Issue" - }, - null - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "users": [ - { - "issue": { - "name": "Memes are the DNA of the soul" - } - }, - { - "issue": null - }, - { - "issue": { - "name": "Names are arbitrary" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml deleted file mode 100644 index 2bbcace98..000000000 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-batch-hydration.yml +++ /dev/null @@ -1,160 +0,0 @@ -name: "deep rename inside batch hydration" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issuesByIds(id: [ID!]): [Issue] - } - type Issue { - name: String @renamed(from: "detail.detailName") - } - UserService: | - type Query { - users: [User] - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issuesByIds" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - detail: IssueDetails - } - - type IssueDetails { - detailName: String - } - - type Query { - issuesByIds(id: [ID!]): [Issue] - } - UserService: | - type Query { - users: [User] - } - - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - users { - issue { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - users { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-1" - }, - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-2" - }, - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-3" - } - ] - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: [ID!]) { - issuesByIds(id: $v0) { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName - } - batch_hydration__issue__id: id - } - } - variables: {"v0":["issue-1","issue-2","issue-3"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "batch_hydration__issue__id": "issue-1", - "deep_rename__name__detail": { - "detailName": "It amounts to nothing" - }, - "__typename__deep_rename__name": "Issue" - }, - { - "batch_hydration__issue__id": "issue-2", - "deep_rename__name__detail": { - "detailName": "Details are cool" - }, - "__typename__deep_rename__name": "Issue" - }, - { - "batch_hydration__issue__id": "issue-3", - "deep_rename__name__detail": { - "detailName": "Names are arbitrary" - }, - "__typename__deep_rename__name": "Issue" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "users": [ - { - "issue": { - "name": "It amounts to nothing" - } - }, - { - "issue": { - "name": "Details are cool" - } - }, - { - "issue": { - "name": "Names are arbitrary" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml deleted file mode 100644 index 9896e98b5..000000000 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydration.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: "deep rename inside hydration" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID!): Issue - } - type Issue { - name: String @renamed(from: "detail.detailName") - } - UserService: | - type Query { - me: User - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issueById" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - detail: IssueDetails - } - - type IssueDetails { - detailName: String - } - - type Query { - issueById(id: ID!): Issue - } - UserService: | - type Query { - me: User - } - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - me { - issue { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - me { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "me": { - "__typename__hydration__issue": "User", - "hydration__issue__issueId": "issue-1" - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName - } - } - } - variables: {"v0":"issue-1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "deep_rename__name__detail": { - "detailName": "Detail-1" - }, - "__typename__deep_rename__name": "Issue" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "me": { - "issue": { - "name": "Detail-1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml deleted file mode 100644 index 1414b99c0..000000000 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-inside-hydrations.yml +++ /dev/null @@ -1,191 +0,0 @@ -name: "deep rename inside hydrations" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID!): Issue - } - type Issue { - name: String @renamed(from: "detail.detailName") - } - UserService: | - type Query { - users: [User] - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issueById" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - detail: IssueDetails - } - - type IssueDetails { - detailName: String - } - - type Query { - issueById(id: ID!): Issue - } - UserService: | - type Query { - users: [User] - } - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - users { - issue { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - users { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "__typename__hydration__issue": "User", - "hydration__issue__issueId": "issue-1" - }, - { - "__typename__hydration__issue": "User", - "hydration__issue__issueId": "issue-2" - }, - { - "__typename__hydration__issue": "User", - "hydration__issue__issueId": "issue-3" - } - ] - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName - } - } - } - variables: {"v0":"issue-1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "deep_rename__name__detail": { - "detailName": "Detail-1" - }, - "__typename__deep_rename__name": "Issue" - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName - } - } - } - variables: {"v0":"issue-2"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "deep_rename__name__detail": { - "detailName": "Detail-2" - }, - "__typename__deep_rename__name": "Issue" - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName - } - } - } - variables: {"v0":"issue-3"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "deep_rename__name__detail": { - "detailName": "A name goes here" - }, - "__typename__deep_rename__name": "Issue" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "users": [ - { - "issue": { - "name": "Detail-1" - } - }, - { - "issue": { - "name": "Detail-2" - } - }, - { - "issue": { - "name": "A name goes here" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml b/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml deleted file mode 100644 index 0544d907e..000000000 --- a/test/src/test/resources/fixtures/deep renames/deep-rename-with-argument-works.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "deep rename with argument works" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issue: Issue - } - type Issue { - name(userId: ID!): String @renamed(from: "detail.detailName") - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - detail: IssueDetails - } - - type IssueDetails { - detailName(userId: ID!): String - } - - type Query { - issue: Issue - } -# language=GraphQL -query: | - query { - issue { - name(userId: "USER-01") - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issue { - __typename__deep_rename__name: __typename - deep_rename__name__detail: detail { - detailName(userId: $v0) - } - } - } - variables: {"v0":"USER-01"} - # language=JSON - response: |- - { - "data": { - "issue": { - "deep_rename__name__detail": { - "detailName": "My Issue" - }, - "__typename__deep_rename__name": "Issue" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "name": "My Issue" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml deleted file mode 100644 index 558897c09..000000000 --- a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-mixed-literals-and-variables.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "inlined all arguments with mixed literals and variables" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: InputArgType): String - } - - input InputArgType @renamed(from: "UnderlyingInputArgType") { - age: Int - inputWithJson: InputWithJson - } - - input InputWithJson @renamed(from: "InputWithJsonUnderlying") { - names: [String!]! - payload: JSON - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - hello(arg: UnderlyingInputArgType): String - } - - input UnderlyingInputArgType { - age: Int - inputWithJson: InputWithJsonUnderlying - } - - input InputWithJsonUnderlying { - names: [String!]! - payload: JSON - } - - scalar JSON -query: | - query myQuery($varX: InputWithJson) { - hello(arg: { age: 50, inputWithJson: $varX } ) - } -variables: - varX: - names: - - "Bobba" - - "Fett" - payload: - name: "Bobert" - age: "23" - -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: UnderlyingInputArgType) { - hello(arg: $v0) - } - variables: {"v0":{"age":50,"inputWithJson":{"names":["Bobba","Fett"],"payload":{"name":"Bobert","age":"23"}}}} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml deleted file mode 100644 index ea9eaff0c..000000000 --- a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field-input-is-wrapped-in-a-list.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "inlined all arguments with renamed field input is wrapped in a list" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: [InputArgType]): Output @renamed(from: "helloUnderlying") - } - - input InputArgType @renamed(from: "UnderlyingInputArgType") { - age: Int - inputWithJson: [InputWithJson] - } - - input InputWithJson @renamed(from: "InputWithJsonUnderlying") { - names: [String!]! - payload: JSON - } - - type Output @renamed(from: "OutputUnderlying") { - value: String - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - helloUnderlying(arg: [UnderlyingInputArgType]): OutputUnderlying - } - - input UnderlyingInputArgType { - age: Int - inputWithJson: [InputWithJsonUnderlying] - } - - input InputWithJsonUnderlying { - names: [String!]! - payload: JSON - } - - type OutputUnderlying { - value: String - } - - scalar JSON -query: | - query myQuery($varX: [InputWithJson]) { - hello(arg: [{ age: 50, inputWithJson: $varX }] ) { - value - } - } -variables: - varX: - - names: - - "Bobba" - - "Fett" - payload: - name: "Bobert" - age: "23" - -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: [UnderlyingInputArgType]) { - rename__hello__helloUnderlying: helloUnderlying(arg: $v0) { - value - } - } - variables: {"v0":[{"age":50,"inputWithJson":[{"names":["Bobba","Fett"],"payload":{"name":"Bobert","age":"23"}}]}]} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "rename__hello__helloUnderlying": { - "value": "world" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": { - "value": "world" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml b/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml deleted file mode 100644 index 1625a6f7d..000000000 --- a/test/src/test/resources/fixtures/document variable handling/inlined-all-arguments-with-renamed-field.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "inlined all arguments with renamed field" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: InputArgType): Output @renamed(from: "helloUnderlying") - } - - input InputArgType @renamed(from: "UnderlyingInputArgType") { - age: Int - inputWithJson: InputWithJson - } - - input InputWithJson @renamed(from: "InputWithJsonUnderlying") { - names: [String!]! - payload: JSON - } - - type Output @renamed(from: "OutputUnderlying") { - value: String - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - helloUnderlying(arg: UnderlyingInputArgType): OutputUnderlying - } - - input UnderlyingInputArgType { - age: Int - inputWithJson: InputWithJsonUnderlying - } - - input InputWithJsonUnderlying { - names: [String!]! - payload: JSON - } - - type OutputUnderlying { - value: String - } - - scalar JSON -query: | - query myQuery($varX: InputWithJson) { - hello(arg: { age: 50, inputWithJson: $varX } ) { - value - } - } -variables: - varX: - names: - - "Bobba" - - "Fett" - payload: - name: "Bobert" - age: "23" - -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: UnderlyingInputArgType) { - rename__hello__helloUnderlying: helloUnderlying(arg: $v0) { - value - } - } - variables: {"v0":{"age":50,"inputWithJson":{"names":["Bobba","Fett"],"payload":{"name":"Bobert","age":"23"}}}} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "rename__hello__helloUnderlying": { - "value": "world" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": { - "value": "world" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml b/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml deleted file mode 100644 index 022e5124c..000000000 --- a/test/src/test/resources/fixtures/document variable handling/inlined-json-arguments.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: "inlined json arguments" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: InputWithJson, arg1: JSON!): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - hello(arg: InputWithJson, arg1: JSON!): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -query: | - query myQuery { - hello(arg: {payload: {name: "Bobert", age: "23"}}, arg1: {interests: ["photography", "basketball"]}) - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: InputWithJson, $v1: JSON!) { - hello(arg: $v0, arg1: $v1) - } - variables: {"v0":{"payload":{"name":"Bobert","age":"23"}},"v1":{"interests":["photography","basketball"]}} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml b/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml deleted file mode 100644 index 13e81b792..000000000 --- a/test/src/test/resources/fixtures/document variable handling/input-object-with-json-field.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: "input object with json field" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: InputWithJson): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - hello(arg: InputWithJson): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -query: | - query myQuery($var: JSON!) { - hello(arg: {payload: $var}) - } -variables: - var: - 48x48: "file.jpeg" -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: InputWithJson) { - hello(arg: $v0) - } - variables: {"v0":{"payload":{"48x48":"file.jpeg"}}} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml b/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml deleted file mode 100644 index c2a7724c8..000000000 --- a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments-variables.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: "primitive json arguments variables" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: InputWithJson, arg1: JSON!): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - hello(arg: InputWithJson, arg1: JSON!): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -query: | - query myQuery($var1: JSON!, $var2: JSON!) { - hello(arg: {payload: $var1}, arg1: $var2) - } -variables: - var1: "String JSON input" - var2: false -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: InputWithJson, $v1: JSON!) { - hello(arg: $v0, arg1: $v1) - } - variables: {"v0":{"payload":"String JSON input"},"v1":false} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml b/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml deleted file mode 100644 index 4765d56a9..000000000 --- a/test/src/test/resources/fixtures/document variable handling/primitive-json-arguments.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: "primitive json arguments" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: InputWithJson, arg1: JSON!): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - hello(arg: InputWithJson, arg1: JSON!): String - } - - input InputWithJson { - payload: JSON - } - - scalar JSON -query: | - query myQuery { - hello(arg: {payload: "String JSON input"}, arg1: false) - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: InputWithJson, $v1: JSON!) { - hello(arg: $v0, arg1: $v1) - } - variables: {"v0":{"payload":"String JSON input"},"v1":false} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": "world" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml deleted file mode 100644 index 88481859b..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-complex-fragments.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: "dynamic service resolution handles complex fragments" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - author: User - } - type User { - name: String - avatarUrl: String - } - IssueService: | - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - author: User - } - - type User { - name: String - avatarUrl: String - } - IssueService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -query: | - { - node(id: "pull-request:id-123") { - ... { - ... { - ... on PullRequest { - id - } - } - } - ... on PullRequest { - description - author { - ... on User { - name - ... { - avatarUrl - } - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "RepoService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - node(id: $v0) { - id - ... on PullRequest { - author { - avatarUrl - name - } - description - } - } - } - variables: {"v0":"pull-request:id-123"} - # language=JSON - response: |- - { - "data": { - "node": { - "id": "pull-request:id-123", - "description": "this is a pull request", - "author": { - "name": "I'm an User", - "avatarUrl": "https://avatar.acme.com/user-123" - } - } - } - } -# language=JSON -response: |- - { - "data": { - "node": { - "id": "pull-request:id-123", - "description": "this is a pull request", - "author": { - "name": "I'm an User", - "avatarUrl": "https://avatar.acme.com/user-123" - } - } - } - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml deleted file mode 100644 index 2e73ba030..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-handles-inline-fragments-from-multiple-services.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: "dynamic service resolution handles inline fragments from multiple services" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -query: | - { - node(id: "pull-request:id-123") { - # this fragment uses a type from the RepoService - ... on PullRequest { - id - description - } - # and this one uses a type from IssueService - ... on Issue { - id - issueKey - } - } - } -variables: { } -serviceCalls: - - serviceName: "RepoService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - node(id: $v0) { - __typename__type_filter__issueKey: __typename - id - ... on PullRequest { - description - } - } - } - variables: {"v0":"pull-request:id-123"} - # language=JSON - response: |- - { - "data": { - "node": { - "__typename__type_filter__issueKey": "PullRequest", - "id": "pull-request:id-123", - "description": "this is a pull request" - } - } - } -# language=JSON -response: |- - { - "data": { - "node": { - "id": "pull-request:id-123", - "description": "this is a pull request" - } - } - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml deleted file mode 100644 index 82888ed58..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services-with-one-unmapped-node-lookup.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: "dynamic service resolution multiple services with one unmapped node lookup" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -query: | - { - commit: node(id: "commit:id-123") { - ... on PullRequest { - id - description - } - } - issue: node(id: "issue/id-123") { - ... on Issue { - id - issueKey - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issue: node(id: $v0) { - id - ... on Issue { - issueKey - } - } - } - variables: {"v0":"issue/id-123"} - # language=JSON - response: |- - { - "data": { - "issue": { - "id": "issue/id-123", - "issueKey": "ISSUE-1" - } - } - } -# language=JSON -response: |- - { - "data": { - "commit": null, - "issue": { - "id": "issue/id-123", - "issueKey": "ISSUE-1" - } - }, - "errors": [ - { - "message": "Could not resolve service for field: /commit", - "locations": [], - "path": [ - "commit"], - "extensions": { - "classification": "ExecutionAborted" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml deleted file mode 100644 index 250d01ee2..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-multiple-services.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: "dynamic service resolution multiple services" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -query: | - { - pr: node(id: "pull-request:id-123") { - ... on PullRequest { - id - description - } - } - issue: node(id: "issue/id-123") { - ... on Issue { - id - issueKey - } - } - } -variables: { } -serviceCalls: - - serviceName: "RepoService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - pr: node(id: $v0) { - id - ... on PullRequest { - description - } - } - } - variables: {"v0":"pull-request:id-123"} - # language=JSON - response: |- - { - "data": { - "pr": { - "id": "pull-request:id-123", - "description": "this is a pull request" - } - } - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issue: node(id: $v0) { - id - ... on Issue { - issueKey - } - } - } - variables: {"v0":"issue/id-123"} - # language=JSON - response: |- - { - "data": { - "issue": { - "id": "issue/id-123", - "issueKey": "ISSUE-1" - } - } - } -# language=JSON -response: |- - { - "data": { - "pr": { - "id": "pull-request:id-123", - "description": "this is a pull request" - }, - "issue": { - "id": "issue/id-123", - "issueKey": "ISSUE-1" - } - } - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml deleted file mode 100644 index af94ab8e9..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-simple-success-case.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: "dynamic service resolution simple success case" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - } -# language=GraphQL -query: | - { - node(id: "pull-request:id-123") { - ... on PullRequest { - id - description - } - } - } -variables: { } -serviceCalls: - - serviceName: "RepoService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - node(id: $v0) { - id - ... on PullRequest { - description - } - } - } - variables: {"v0":"pull-request:id-123"} - # language=JSON - response: |- - { - "data": { - "node": { - "id": "pull-request:id-123", - "description": "this is a pull request" - } - } - } -# language=JSON -response: |- - { - "data": { - "node": { - "id": "pull-request:id-123", - "description": "this is a pull request" - } - } - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml b/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml deleted file mode 100644 index 12458a248..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/dynamic-service-resolution-with-no-fragments.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "dynamic service resolution with no fragments" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - } - IssueService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type Issue implements Node { - id: ID! - issueKey: String - } -# language=GraphQL -query: | - { - node(id: "pull-request:id-123") { - id - } - } -variables: { } -serviceCalls: - - serviceName: "RepoService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - node(id: $v0) { - id - } - } - variables: {"v0":"pull-request:id-123"} - # language=JSON - response: |- - { - "data": { - "node": { - "id": "pull-request:id-123" - } - } - } -# language=JSON -response: |- - { - "data": { - "node": { - "id": "pull-request:id-123" - } - } - } diff --git a/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml b/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml deleted file mode 100644 index 51077c120..000000000 --- a/test/src/test/resources/fixtures/dynamic service resolution/typename-is-passed-on-queries-using-dynamic-resolved-services.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: "__typename is passed on queries using dynamic resolved services" -enabled: true -# language=GraphQL -overallSchema: - shared: | - directive @dynamicServiceResolution on FIELD_DEFINITION - - type Query { - node(id: ID!): Node @dynamicServiceResolution - } - - interface Node { - id: ID! - } - RepoService: | - type PullRequest implements Node { - id: ID! - description: String - } -# language=GraphQL -underlyingSchema: - shared: | - type Query { - echo: String - } - RepoService: | - type Query { - node(id: ID): Node - } - - interface Node { - id: ID! - } - - type PullRequest implements Node { - id: ID! - description: String - } -# language=GraphQL -query: | - { - node(id: "pull-request:id-123") { - __typename - ... on PullRequest { - id - description - } - } - } -variables: { } -serviceCalls: - - serviceName: "RepoService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - node(id: $v0) { - __typename - id - ... on PullRequest { - description - } - } - } - variables: {"v0":"pull-request:id-123"} - # language=JSON - response: |- - { - "data": { - "node": { - "id": "pull-request:id-123", - "description": "this is a pull request", - "__typename": "PullRequest" - } - } - } -# language=JSON -response: |- - { - "data": { - "node": { - "__typename": "PullRequest", - "id": "pull-request:id-123", - "description": "this is a pull request" - } - } - } diff --git a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml b/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml deleted file mode 100644 index f1973dae8..000000000 --- a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible-with-synthetic-fields.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: "extending types from another service is possible with synthetic fields" -enabled: true -# language=GraphQL -overallSchema: - Service2: | - type Query { - lookUpQuery: LookUpQuery - } - type LookUpQuery { - lookup(id: ID): Extension - } - extend type Root { - extension: Extension - @hydrated( - service: "Service2" - field: "lookUpQuery.lookup" - arguments: [{name: "id" value: "$source.id"}] - identifiedBy: "id" - ) - } - type Extension { - id: ID - name: String - } - Service1: | - extend type Query { - root: Root - } - extend type Query { - anotherRoot: String - } - type Root { - id: ID - } - extend type Root { - name: String - } -# language=GraphQL -underlyingSchema: - Service2: | - type Extension { - id: ID - name: String - } - - type LookUpQuery { - lookup(id: ID): Extension - } - - type Query { - lookUpQuery: LookUpQuery - } - Service1: | - type Query { - root: Root - } - - extend type Query { - anotherRoot: String - } - - type Root { - id: ID - } - - extend type Root { - name: String - } -# language=GraphQL -query: | - query { - root { - id - name - extension { - id - name - } - } - anotherRoot - } -variables: { } -serviceCalls: - - serviceName: "Service1" - request: - # language=GraphQL - query: | - query { - anotherRoot - } - variables: { } - # language=JSON - response: |- - { - "data": { - "anotherRoot": "anotherRoot" - }, - "extensions": {} - } - - serviceName: "Service1" - request: - # language=GraphQL - query: | - query { - root { - __typename__hydration__extension: __typename - id - hydration__extension__id: id - name - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "root": { - "id": "rootId", - "hydration__extension__id": "rootId", - "__typename__hydration__extension": "Root", - "name": "rootName" - } - }, - "extensions": {} - } - - serviceName: "Service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - lookUpQuery { - lookup(id: $v0) { - id - name - } - } - } - variables: {"v0":"rootId"} - # language=JSON - response: |- - { - "data": { - "lookUpQuery": { - "lookup": { - "id": "rootId", - "name": "extensionName" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "root": { - "id": "rootId", - "extension": { - "id": "rootId", - "name": "extensionName" - }, - "name": "rootName" - }, - "anotherRoot": "anotherRoot" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml b/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml deleted file mode 100644 index 2a96e4041..000000000 --- a/test/src/test/resources/fixtures/extend type/extending-types-from-another-service-is-possible.yml +++ /dev/null @@ -1,156 +0,0 @@ -name: "extending types from another service is possible" -enabled: true -# language=GraphQL -overallSchema: - Service2: | - type Query { - lookup(id: ID): Extension - } - extend type Root { - extension: Extension - @hydrated( - service: "Service2" - field: "lookup" - arguments: [{name: "id" value: "$source.id"}] - identifiedBy: "id" - ) - } - type Extension { - id: ID - name: String - } - Service1: | - extend type Query { - root: Root - } - extend type Query { - anotherRoot: String - } - type Root { - id: ID - } - extend type Root { - name: String - } -# language=GraphQL -underlyingSchema: - Service2: | - type Extension { - id: ID - name: String - } - - type Query { - lookup(id: ID): Extension - } - Service1: | - type Query { - root: Root - } - - extend type Query { - anotherRoot: String - } - - type Root { - id: ID - } - - extend type Root { - name: String - } -# language=GraphQL -query: | - query { - root { - id - name - extension { - id - name - } - } - anotherRoot - } -variables: { } -serviceCalls: - - serviceName: "Service1" - request: - # language=GraphQL - query: | - query { - anotherRoot - } - variables: { } - # language=JSON - response: |- - { - "data": { - "anotherRoot": "anotherRoot" - }, - "extensions": {} - } - - serviceName: "Service1" - request: - # language=GraphQL - query: | - query { - root { - __typename__hydration__extension: __typename - id - hydration__extension__id: id - name - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "root": { - "id": "rootId", - "hydration__extension__id": "rootId", - "__typename__hydration__extension": "Root", - "name": "rootName" - } - }, - "extensions": {} - } - - serviceName: "Service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - lookup(id: $v0) { - id - name - } - } - variables: {"v0":"rootId"} - # language=JSON - response: |- - { - "data": { - "lookup": { - "id": "rootId", - "name": "extensionName" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "root": { - "id": "rootId", - "extension": { - "id": "rootId", - "name": "extensionName" - }, - "name": "rootName" - }, - "anotherRoot": "anotherRoot" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml deleted file mode 100644 index f688d2899..000000000 --- a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-returning-a-connection.yml +++ /dev/null @@ -1,205 +0,0 @@ -name: "extending types via hydration returning a connection" -enabled: true -# language=GraphQL -overallSchema: - Issue: | - type Query { - synth: Synth - } - type Synth { - issue: Issue - } - type Issue { - id: ID - } - Association: | - type Query { - association(id: ID, filter: Filter): AssociationConnection - pages: Pages - } - type Pages { - page(id: ID): Page - } - type AssociationConnection { - nodes: [Association] - } - input Filter { - name: String - } - type Association { - id: ID - nameOfAssociation: String - page: Page - @hydrated( - service: "Association" - field: "pages.page" - arguments: [{name: "id" value: "$source.pageId"}] - ) - } - type Page { - id: ID - } - extend type Issue { - association(filter: Filter): AssociationConnection - @hydrated( - service: "Association" - field: "association" - arguments: [{name: "id" value: "$source.id"} {name: "filter" value: "$argument.filter"}] - ) - } -# language=GraphQL -underlyingSchema: - Issue: | - type Issue { - id: ID - } - - type Query { - synth: Synth - } - - type Synth { - issue: Issue - } - Association: | - type Association { - id: ID - nameOfAssociation: String - pageId: ID - } - - type AssociationConnection { - nodes: [Association] - } - - type Page { - id: ID - } - - type Pages { - page(id: ID): Page - } - - type Query { - association(filter: Filter, id: ID): AssociationConnection - pages: Pages - } - - input Filter { - name: String - } -# language=GraphQL -query: | - query { - synth { - issue { - association(filter: {name: "value"}) { - nodes { - page { - id - } - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issue" - request: - # language=GraphQL - query: | - query { - synth { - issue { - __typename__hydration__association: __typename - hydration__association__id: id - } - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "synth": { - "issue": { - "hydration__association__id": "ISSUE-1", - "__typename__hydration__association": "Issue" - } - } - }, - "extensions": {} - } - - serviceName: "Association" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: Filter) { - association(filter: $v1, id: $v0) { - nodes { - __typename__hydration__page: __typename - hydration__page__pageId: pageId - } - } - } - variables: {"v0":"ISSUE-1","v1":{"name":"value"}} - # language=JSON - response: |- - { - "data": { - "association": { - "nodes": [ - { - "__typename__hydration__page": "Association", - "hydration__page__pageId": "1" - } - ] - } - }, - "extensions": {} - } - - serviceName: "Association" - request: - # language=GraphQL - query: | - query ($v0: ID) { - pages { - page(id: $v0) { - id - } - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "pages": { - "page": { - "id": "1" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "synth": { - "issue": { - "association": { - "nodes": [ - { - "page": { - "id": "1" - } - } - ] - } - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml deleted file mode 100644 index fbd6339d5..000000000 --- a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-arguments-passed-on.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: "extending types via hydration with arguments passed on" -enabled: true -# language=GraphQL -overallSchema: - Issue: | - type Query { - issue: Issue - } - type Issue { - id: ID - } - Association: | - type Query { - association(id: ID, filter: Filter): Association - } - input Filter { - name: String - } - type Association { - id: ID - nameOfAssociation: String - } - extend type Issue { - association(filter: Filter): Association - @hydrated( - service: "Association" - field: "association" - arguments: [{name: "id" value: "$source.id"} {name: "filter" value: "$argument.filter"}] - ) - } -# language=GraphQL -underlyingSchema: - Issue: | - type Issue { - id: ID - } - - type Query { - issue: Issue - } - Association: | - type Association { - id: ID - nameOfAssociation: String - } - - type Query { - association(filter: Filter, id: ID): Association - } - - input Filter { - name: String - } -# language=GraphQL -query: | - query { - issue { - association(filter: {name: "value"}) { - nameOfAssociation - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issue" - request: - # language=GraphQL - query: | - query { - issue { - __typename__hydration__association: __typename - hydration__association__id: id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__association__id": "ISSUE-1", - "__typename__hydration__association": "Issue" - } - }, - "extensions": {} - } - - serviceName: "Association" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: Filter) { - association(filter: $v1, id: $v0) { - nameOfAssociation - } - } - variables: {"v0":"ISSUE-1","v1":{"name":"value"}} - # language=JSON - response: |- - { - "data": { - "association": { - "nameOfAssociation": "ASSOC NAME" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "association": { - "nameOfAssociation": "ASSOC NAME" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml b/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml deleted file mode 100644 index 18582c642..000000000 --- a/test/src/test/resources/fixtures/extend type/extending-types-via-hydration-with-variables-arguments.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: "extending types via hydration with variables arguments" -enabled: true -# language=GraphQL -overallSchema: - Issue: | - type Query { - issue: Issue - } - type Issue { - id: ID - } - Association: | - type Query { - association(id: ID, filter: Filter): RenamedAssociation - } - input Filter { - name: String - } - type RenamedAssociation @renamed(from: "Association") { - id: ID - nameOfAssociation: String - } - extend type Issue { - association(filter: Filter): RenamedAssociation - @hydrated( - service: "Association" - field: "association" - arguments: [{name: "id" value: "$source.id"} {name: "filter" value: "$argument.filter"}] - ) - } -# language=GraphQL -underlyingSchema: - Issue: | - type Issue { - id: ID - } - - type Query { - issue: Issue - } - Association: | - type Association { - id: ID - nameOfAssociation: String - } - - type Query { - association(filter: Filter, id: ID): Association - } - - input Filter { - name: String - } -# language=GraphQL -query: | - query MyQuery($filter: Filter) { - issue { - association(filter: $filter) { - nameOfAssociation - } - } - } -variables: - filter: - name: "value" -serviceCalls: - - serviceName: "Issue" - request: - # language=GraphQL - query: | - query MyQuery { - issue { - __typename__hydration__association: __typename - hydration__association__id: id - } - } - variables: { } - operationName: "MyQuery" - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__association__id": "ISSUE-1", - "__typename__hydration__association": "Issue" - } - }, - "extensions": {} - } - - serviceName: "Association" - request: - # language=GraphQL - query: | - query MyQuery($v0: ID, $v1: Filter) { - association(filter: $v1, id: $v0) { - nameOfAssociation - } - } - variables: {"v0":"ISSUE-1","v1":{"name":"value"}} - operationName: "MyQuery" - # language=JSON - response: |- - { - "data": { - "association": { - "nameOfAssociation": "ASSOC NAME" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "association": { - "nameOfAssociation": "ASSOC NAME" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml b/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml deleted file mode 100644 index 220545fc4..000000000 --- a/test/src/test/resources/fixtures/field removed/hidden-namespaced-hydration-top-level-field-is-removed.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: "hidden namespaced hydration top level field is removed" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - directive @namespaced on FIELD_DEFINITION - type Query { - issueById(id: ID): Issue @namespaced - } - type Issue { - id: ID - comment: Comment @hydrated( - service: "CommentService" - field: "commentApi.commentById" - arguments: [ - {name: "id", value: "$source.commentId"} - ] - ) - } - CommentService: | - directive @toBeDeleted on FIELD_DEFINITION - type Query { - commentApi: CommentApi @namespaced @hidden - echo: String - } - type CommentApi { - commentById(id: ID): Comment @toBeDeleted @hidden - echo: String - } - type Comment { - id: ID - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Query { - issueById(id: ID): Issue - } - type Issue { - id: ID - commentId: ID - } - CommentService: | - type Query { - commentApi: CommentApi - echo: String - } - type CommentApi { - commentById(id: ID): Comment - echo: String - } - type Comment { - id: ID - } -# language=GraphQL -query: | - query { - issueById(id: "C1") { - id - comment { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issueById(id: $v0) { - __typename__hydration__comment: __typename - hydration__comment__commentId: commentId - id - } - } - variables: {"v0":"C1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "__typename__hydration__comment": "Issue", - "hydration__comment__commentId": "C1", - "id": "C1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issueById": { - "id": "C1", - "comment": null - } - }, - "errors": [ - { - "message": "field `CommentApi.commentById` has been removed by RemoveFieldTestTransform", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml b/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml deleted file mode 100644 index edf73766f..000000000 --- a/test/src/test/resources/fixtures/field removed/hydration-top-level-field-is-removed.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: "hydration top level field is removed" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID): Issue - } - type Issue { - id: ID - comment: Comment @hydrated( - service: "CommentService" - field: "commentById" - arguments: [ - {name: "id", value: "$source.commentId"} - ] - ) - } - CommentService: | - directive @toBeDeleted on FIELD_DEFINITION - type Query { - commentById(id: ID): Comment @toBeDeleted - } - type Comment { - id: ID - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Query { - issueById(id: ID): Issue - } - type Issue { - id: ID - commentId: ID - } - CommentService: | - type Query { - commentById(id: ID): Comment - } - type Comment { - id: ID - } -# language=GraphQL -query: | - query { - issueById(id: "C1") { - id - comment { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issueById(id: $v0) { - __typename__hydration__comment: __typename - hydration__comment__commentId: commentId - id - } - } - variables: {"v0":"C1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "__typename__hydration__comment": "Issue", - "hydration__comment__commentId": "C1", - "id": "C1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issueById": { - "id": "C1", - "comment": null - } - }, - "errors": [ - { - "message": "field `Query.commentById` has been removed by RemoveFieldTestTransform", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml b/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml deleted file mode 100644 index a444e1238..000000000 --- a/test/src/test/resources/fixtures/field removed/namespaced-hydration-top-level-field-is-removed.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: "namespaced hydration top level field is removed" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - directive @namespaced on FIELD_DEFINITION - type Query { - issueById(id: ID): Issue @namespaced - } - type Issue { - id: ID - comment: Comment @hydrated( - service: "CommentService" - field: "commentApi.commentById" - arguments: [ - {name: "id", value: "$source.commentId"} - ] - ) - } - CommentService: | - directive @toBeDeleted on FIELD_DEFINITION - type Query { - commentApi: CommentApi @namespaced - } - type CommentApi { - commentById(id: ID): Comment @toBeDeleted - } - type Comment { - id: ID - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Query { - issueById(id: ID): Issue - } - type Issue { - id: ID - commentId: ID - } - CommentService: | - type Query { - commentApi: CommentApi - } - type CommentApi { - commentById(id: ID): Comment - } - type Comment { - id: ID - } -# language=GraphQL -query: | - query { - issueById(id: "C1") { - id - comment { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issueById(id: $v0) { - __typename__hydration__comment: __typename - hydration__comment__commentId: commentId - id - } - } - variables: {"v0":"C1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "__typename__hydration__comment": "Issue", - "hydration__comment__commentId": "C1", - "id": "C1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issueById": { - "id": "C1", - "comment": null - } - }, - "errors": [ - { - "message": "field `CommentApi.commentById` has been removed by RemoveFieldTestTransform", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml b/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml deleted file mode 100644 index c95ef09b6..000000000 --- a/test/src/test/resources/fixtures/field removed/renamed-top-level-field-is-not-removed-short-circuit-hint-is-on.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "renamed top level field is not removed short circuit hint is on" -enabled: true -# language=GraphQL -overallSchema: - CommentService: | - directive @toBeDeleted on FIELD_DEFINITION - type Query { - commentById(id: ID): Comment @renamed(from: "commentByIdUnderlying") - } - type Comment { - id: ID - } -# language=GraphQL -underlyingSchema: - CommentService: | - type Query { - commentByIdUnderlying(id: ID): Comment - } - type Comment { - id: ID - } -# language=GraphQL -query: | - query { - commentById(id: "C1") { - id - } - } -variables: { } -serviceCalls: - - serviceName: "CommentService" - request: - # language=GraphQL - query: | - query ($v0: ID) { - rename__commentById__commentByIdUnderlying: commentByIdUnderlying(id: $v0) { - id - } - } - variables: {"v0":"C1"} - # language=JSON - response: |- - { - "data": { - "rename__commentById__commentByIdUnderlying": { - "id": "C1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "commentById": { - "id": "C1" - } - }, - "extensions": {} - } \ No newline at end of file diff --git a/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml b/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml deleted file mode 100644 index 7d463e6b1..000000000 --- a/test/src/test/resources/fixtures/graphqlcontext/graphqlcontext-is-present-on-input.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: "graphqlcontext-is-present-on-input" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello(arg: String): World - } - type World { - id: ID - name: String - } -# language=GraphQL -underlyingSchema: - MyService: | - type Query { - hello(arg: String): World - } - - type World { - id: ID - name: String - } -# language=GraphQL -query: | - query { - hello(arg: "x") { - name - } - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query ($v0: String) { - hello(arg: $v0) { - name - } - } - variables: {"v0":"x"} - # language=JSON - response: |- - { - "data": { - "hello": null - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "hello": null - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/introspection/introspection-with-variables.yml b/test/src/test/resources/fixtures/introspection/introspection-with-variables.yml deleted file mode 100644 index 31875dd70..000000000 --- a/test/src/test/resources/fixtures/introspection/introspection-with-variables.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: "introspection with variables" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - earth: Planet - pluto: Planet @deprecated(reason: "Oh no") - } - type Planet { - id: ID - } - type Mutation { - hello: String - } -# language=GraphQL -underlyingSchema: - MyService: | - type Mutation { - hello: String - } - - type Query { - earth: Planet - pluto: Planet @deprecated(reason: "Oh no") - } - - type Planet { - id: ID - name: String - } -# language=GraphQL -query: | - query { - __schema { - queryType { - fields(includeDeprecated: true) { - name - isDeprecated - } - } - } - } -variables: { } -serviceCalls: [ ] -# language=JSON -response: |- - { - "data": { - "__schema": { - "queryType": { - "fields": [ - { - "name": "earth", - "isDeprecated": false - }, - { - "name": "pluto", - "isDeprecated": true - } - ] - } - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml b/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml deleted file mode 100644 index 5de6a92c3..000000000 --- a/test/src/test/resources/fixtures/java-compat/java-ari-transform.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "java ari transform" -enabled: true -# language=GraphQL -overallSchema: - service: | - directive @interpretAri on ARGUMENT_DEFINITION - type Query { - issue(id: ID @interpretAri): Issue - } - type Issue { - key: ID @renamed(from: "id") - } -# language=GraphQL -underlyingSchema: - service: | - type Query { - issue(id: ID): Issue - } - type Issue { - id: ID - } -# language=GraphQL -query: | - query { - issue(id: "ari:/i-forget-what-aris-actually-look-like/57") { - key - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(id: $v0) { - __typename__rename__key: __typename - rename__key__id: id - } - } - variables: {"v0":"57"} - # language=JSON - response: |- - { - "data": { - "issue": { - "__typename__rename__key": "Issue", - "rename__key__id": "57" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "key": "57" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml b/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml deleted file mode 100644 index f0c9e04c9..000000000 --- a/test/src/test/resources/fixtures/new hydration/able-to-ask-for-field-and-use-same-field-as-hydration-source.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: "able to ask for field and use same field as hydration source" -enabled: true -# language=GraphQL -overallSchema: - Bar: |- - type Query { - bar: Bar - barById(id: ID): Bar - } - type Bar { - barId: ID - name: String - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - Bar: |- - type Bar { - barId: ID - name: String - } - - type Query { - bar: Bar - barById(id: ID): Bar - } -# language=GraphQL -query: |- - query { - bar { - barId - nestedBar { - nestedBar { - barId - } - barId - } - name - } - } -variables: { } -serviceCalls: - - serviceName: "Bar" - request: - # language=GraphQL - query: | - { - bar { - __typename__hydration__nestedBar: __typename - barId - hydration__nestedBar__barId: barId - name - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "bar": { - "__typename__hydration__nestedBar": "Bar", - "barId": "1", - "hydration__nestedBar__barId": "1", - "name": "Test" - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - __typename__hydration__nestedBar: __typename - hydration__nestedBar__barId: barId - barId - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "barById": { - "__typename__hydration__nestedBar": "Bar", - "hydration__nestedBar__barId": "1", - "barId": "1" - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - barId - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "barById": { - "barId": "1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "bar": { - "barId": "1", - "nestedBar": { - "barId": "1", - "nestedBar": { - "barId": "1" - } - }, - "name": "Test" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml deleted file mode 100644 index aadd713cd..000000000 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-batch-hydration.yml +++ /dev/null @@ -1,176 +0,0 @@ -name: "some object fields in the result are backed a batch hydration" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [IActivity] - } - interface IActivity { - user: User - } - type Activity implements IActivity { - id: ID! - user: User - @hydrated( - service: "users" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.userId"}] - inputIdentifiedBy: [{sourceId: "userId" resultId: "id"}] - ) - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - activity: | - type Query { - activity: [IActivity] - } - type User { - id: ID! - name: String - } - interface IActivity { - user: User - } - type Activity implements IActivity { - id: ID! - userId: ID - user: User @deprecated(reason: "Fake") - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - { - activity { - user { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - ... on Activity { - __typename__batch_hydration__user: __typename - batch_hydration__user__userId: userId - } - ... on SingleActivity { - user { - name - } - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "__typename__batch_hydration__user": "Activity", - "batch_hydration__user__userId": "user-100" - }, - { - "__typename__batch_hydration__user": "Activity", - "batch_hydration__user__userId": "user-20" - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - usersByIds(ids: $v0) { - batch_hydration__user__id: id - name - } - } - variables: {"v0":["user-100","user-20"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "batch_hydration__user__id": "user-100", - "name": "Spaces" - }, - { - "batch_hydration__user__id": "user-20", - "name": "Newmarket" - } - ] - }, - "extensions": {} - } -# language=JSON -response: | - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "user": { - "name": "Spaces" - } - }, - { - "user": { - "name": "Newmarket" - } - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml deleted file mode 100644 index bdc88a611..000000000 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-object-fields-in-the-result-are-backed-a-hydration.yml +++ /dev/null @@ -1,187 +0,0 @@ -name: "some object fields in the result are backed a hydration" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [IActivity] - } - interface IActivity { - user: User - } - type Activity implements IActivity { - id: ID! - user: User - @hydrated( - service: "users" - field: "userById" - arguments: [{name: "id" value: "$source.userId"}] - ) - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - userById(id: ID!): User - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - activity: | - type Query { - activity: [IActivity] - } - type User { - id: ID! - name: String - } - interface IActivity { - user: User - } - type Activity implements IActivity { - id: ID! - userId: ID - user: User @deprecated(reason: "Fake") - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - userById(id: ID!): User - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - { - activity { - user { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - ... on Activity { - __typename__hydration__user: __typename - hydration__user__userId: userId - } - ... on SingleActivity { - user { - name - } - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "__typename__hydration__user": "Activity", - "hydration__user__userId": "user-100" - }, - { - "__typename__hydration__user": "Activity", - "hydration__user__userId": "user-20" - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - userById(id: $v0) { - name - } - } - variables: {"v0":"user-100"} - # language=JSON - response: |- - { - "data": { - "userById": { - "name": "Hello" - } - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - userById(id: $v0) { - name - } - } - variables: {"v0":"user-20"} - # language=JSON - response: |- - { - "data": { - "userById": { - "name": "World" - } - }, - "extensions": {} - } -# language=JSON -response: | - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "user": { - "name": "Hello" - } - }, - { - "user": { - "name": "World" - } - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml deleted file mode 100644 index daf964a61..000000000 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-batch-hydration.yml +++ /dev/null @@ -1,176 +0,0 @@ -name: "some renamed object types have fields in the result are backed a batch hydration" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [IActivity] - } - interface IActivity { - user: User - } - type Activity implements IActivity { - id: ID! - user: User - @hydrated( - service: "users" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.userId"}] - inputIdentifiedBy: [{sourceId: "userId" resultId: "id"}] - ) - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - activity: | - type Query { - activity: [IActivity] - } - type User { - id: ID! - name: String - } - interface IActivity { - user: User - } - type Activity implements IActivity { - id: ID! - userId: ID - user: User @deprecated(reason: "Fake") - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - { - activity { - user { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - ... on Activity { - __typename__batch_hydration__user: __typename - batch_hydration__user__userId: userId - } - ... on SingleActivity { - user { - name - } - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "__typename__batch_hydration__user": "Activity", - "batch_hydration__user__userId": "user-100" - }, - { - "__typename__batch_hydration__user": "Activity", - "batch_hydration__user__userId": "user-20" - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - usersByIds(ids: $v0) { - batch_hydration__user__id: id - name - } - } - variables: {"v0":["user-100","user-20"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "batch_hydration__user__id": "user-100", - "name": "Spaces" - }, - { - "batch_hydration__user__id": "user-20", - "name": "Newmarket" - } - ] - }, - "extensions": {} - } -# language=JSON -response: | - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "user": { - "name": "Spaces" - } - }, - { - "user": { - "name": "Newmarket" - } - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml b/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml deleted file mode 100644 index edd59c943..000000000 --- a/test/src/test/resources/fixtures/new hydration/abstract types/some-renamed-object-types-have-fields-in-the-result-are-backed-a-hydration.yml +++ /dev/null @@ -1,187 +0,0 @@ -name: "some renamed object types have fields in the result are backed a hydration" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [IActivity] - } - interface IActivity { - user: User - } - type Activity implements IActivity @renamed(from: "SomethingLame") { - id: ID! - user: User - @hydrated( - service: "users" - field: "userById" - arguments: [{name: "id" value: "$source.userId"}] - ) - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - userById(id: ID!): User - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - activity: | - type Query { - activity: [IActivity] - } - type User { - id: ID! - name: String - } - interface IActivity { - user: User - } - type SomethingLame implements IActivity { - id: ID! - userId: ID - user: User @deprecated(reason: "Fake") - } - type SingleActivity implements IActivity { - id: ID! - user: User - } - users: | - type Query { - userById(id: ID!): User - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - { - activity { - user { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - ... on SingleActivity { - user { - name - } - } - ... on SomethingLame { - __typename__hydration__user: __typename - hydration__user__userId: userId - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "__typename__hydration__user": "SomethingLame", - "hydration__user__userId": "user-100" - }, - { - "__typename__hydration__user": "SomethingLame", - "hydration__user__userId": "user-20" - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - userById(id: $v0) { - name - } - } - variables: {"v0":"user-100"} - # language=JSON - response: |- - { - "data": { - "userById": { - "name": "Hello" - } - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - userById(id: $v0) { - name - } - } - variables: {"v0":"user-20"} - # language=JSON - response: |- - { - "data": { - "userById": { - "name": "World" - } - }, - "extensions": {} - } -# language=JSON -response: | - { - "data": { - "activity": [ - { - "user": { - "name": "John" - } - }, - { - "user": { - "name": "Hello" - } - }, - { - "user": { - "name": "World" - } - }, - { - "user": { - "name": "Mayor" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml b/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml deleted file mode 100644 index 4f8b5afcd..000000000 --- a/test/src/test/resources/fixtures/new hydration/all-hydration-fields-are-seen-by-transformer.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: "all hydration fields are seen by transformer" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - bars: BarQuery - } - type BarQuery { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "bars.barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - bars: BarQuery - } - type BarQuery { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - bars { - barById(id: $v0) { - name - } - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "bars": { - "barById": { - "name": "Bar1" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml deleted file mode 100644 index ea96e8020..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-equals-condition.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: "basic conditional hydration with true equals condition" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "$source.barId" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "someType" } - } - } - ) - } -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "someType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml deleted file mode 100644 index cd87a4848..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-matches-condition.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: "basic conditional hydration with true matches condition" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "$source.barId" - } - ] - when: { - result: { - sourceField: "type" - predicate: { matches: "[a-z]+Type" } - } - } - ) - } -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "someType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml b/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml deleted file mode 100644 index a3d9e8006..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-conditional-hydration-with-true-starts-with-condition.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: "basic conditional hydration with true startsWith condition" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "$source.barId" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "some" } - } - } - ) - } -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "someType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml deleted file mode 100644 index 366f7874f..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-directive-based.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: "basic hydration directive based" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - ] - ) - barLongerInput: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.fooDetails.externalBarId"} - ] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml deleted file mode 100644 index 8dbeda085..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-actor-field-rename.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: "basic hydration with actor field rename" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barByIdOverall(id: ID): Bar @renamed(from: "barById") - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barByIdOverall" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barByIdOverall" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - rename__barByIdOverall__barById: barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "rename__barByIdOverall__barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml deleted file mode 100644 index f11f40dc7..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-array-argument-values.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: "basic hydration with default array argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - barById(id: ID, test: [String]): Bar - } - type Bar { - id: ID - name: String - } - # language=GraphQL - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar(test: [String] = ["Hello", "World"]): Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - {name: "test" value: "$argument.test"} - ] - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, test: [String]): Bar - } - # language=GraphQL - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: [String]) { - barById(id: $v0, test: $v1) { - name - } - } - variables: {"v0":"barId","v1":["Hello","World"]} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml deleted file mode 100644 index e10fa5fcc..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-boolean-argument-values.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: "basic hydration with default boolean argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - barById(id: ID, test: Boolean): Bar - } - type Bar { - id: ID - name: String - } - # language=GraphQL - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar(test: Boolean = false): Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - {name: "test" value: "$argument.test"} - ] - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, test: Boolean): Bar - } - # language=GraphQL - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: Boolean) { - barById(id: $v0, test: $v1) { - name - } - } - variables: {"v0":"barId","v1":false} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml deleted file mode 100644 index 7fd989e26..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-int-argument-values.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: "basic hydration with default int argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - barById(id: ID, test: Int): Bar - } - type Bar { - id: ID - name: String - } - # language=GraphQL - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar(test: Int = 10): Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - {name: "test" value: "$argument.test"} - ] - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, test: Int): Bar - } - # language=GraphQL - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: Int) { - barById(id: $v0, test: $v1) { - name - } - } - variables: {"v0":"barId","v1":10} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml deleted file mode 100644 index 9be5fd058..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-null-argument-values.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: "basic hydration with default null argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - barById(id: ID, test: Boolean = true): Bar - } - type Bar { - id: ID - name: String - } - # language=GraphQL - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar(test: Boolean = null): Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - {name: "test" value: "$argument.test"} - ] - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, test: Boolean = true): Bar - } - # language=GraphQL - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: Boolean) { - barById(id: $v0, test: $v1) { - name - } - } - variables: {"v0":"barId","v1":null} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml deleted file mode 100644 index 5f3737d2e..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-object-argument-values.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: "basic hydration with default object argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - barById(id: ID, test: Test): Bar - } - type Bar { - id: ID - name: String - } - input Test { - string: String = "Test" - int: Int = 42 - bool: Boolean = false - number: Int - echo: String - } - # language=GraphQL - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar(test: Test = {echo: "Hello World"}): Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - {name: "test" value: "$argument.test"} - ] - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, test: Test = {}): Bar - } - - input Test { - string: String = "Test" - int: Int = 42 - bool: Boolean = false - number: Int - echo: String - } - # language=GraphQL - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: Test) { - barById(id: $v0, test: $v1) { - name - } - } - variables: {"v0":"barId","v1":{"echo":"Hello World"}} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml deleted file mode 100644 index 90af72acb..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-default-string-argument-values.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: "basic hydration with default string argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - barById(id: ID, test: String): Bar - } - type Bar { - id: ID - name: String - } - # language=GraphQL - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar(test: String = "Hello World"): Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - {name: "test" value: "$argument.test"} - ] - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, test: String): Bar - } - # language=GraphQL - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: String) { - barById(id: $v0, test: $v1) { - name - } - } - variables: {"v0":"barId","v1":"Hello World"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml deleted file mode 100644 index f101e6ef2..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-array.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: "basic hydration with static arg array" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID, friendIds: [ID]): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { name: "id" value: "$source.id" } - { name: "friendIds" value: ["barId2", "barId3", "barId4"] } - ] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, friendIds: [ID]): Bar - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__id: id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__id": "barId" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: [ID]) { - barById(friendIds: $v1, id: $v0) { - name - } - } - variables: {"v0":"barId","v1":["barId2","barId3","barId4"]} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml deleted file mode 100644 index bf4e87aec..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-boolean.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: "basic hydration with static arg boolean" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barWithSomeAttribute(someAttribute: Boolean): Bar - } - type Bar { - id: ID - name: String - someAttribute: Boolean - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barWithSomeAttribute" - arguments: [{name: "someAttribute" value: true}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - someAttribute: Boolean - } - - type Query { - barWithSomeAttribute(someAttribute: Boolean): Bar - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__bar: __typename - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: Boolean) { - barWithSomeAttribute(someAttribute: $v0) { - name - } - } - variables: {"v0":true} - # language=JSON - response: |- - { - "data": { - "barWithSomeAttribute": { - "name": "Bar12345" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar12345" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml deleted file mode 100644 index a2b28bc8a..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-float.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: "basic hydration with static arg float" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barWithSomeFloat(someFloat: Float): Bar - } - type Bar { - id: ID - name: String - someFloat: Float - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barWithSomeFloat" - arguments: [{name: "someFloat" value: 123.45}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - someFloat: Float - } - - type Query { - barWithSomeFloat(someFloat: Float): Bar - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__bar: __typename - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: Float) { - barWithSomeFloat(someFloat: $v0) { - name - } - } - variables: {"v0":123.45} - # language=JSON - response: |- - { - "data": { - "barWithSomeFloat": { - "name": "Bar12345" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar12345" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml deleted file mode 100644 index 1ea0a5f78..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-integer.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: "basic hydration with static arg integer" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: Int): Bar - } - type Bar { - id: Int - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: 12345}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: Int - name: String - } - - type Query { - barById(id: Int): Bar - } - service1: | - type Foo { - barId: Int - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__bar: __typename - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: Int) { - barById(id: $v0) { - name - } - } - variables: {"v0":12345} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar12345" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar12345" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml deleted file mode 100644 index 93c962d56..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object-array.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: "basic hydration with static arg object array" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID, friends: [FullName]): Bar - } - type Bar { - id: ID - name: String - } - input FullName { - firstName: String - lastName: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - { name: "id" value: "$source.id" } - { - name: "friends" - value: [ - { - firstName: "first" - lastName: "last" - } - { - firstName: "first2" - lastName: "last2" - } - { - firstName: "first3" - lastName: "last3" - } - ] - } - ] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, friends: [FullName]): Bar - } - - input FullName { - firstName: String - lastName: String - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__id: id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__id": "barId" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: [FullName]) { - barById(friends: $v1, id: $v0) { - name - } - } - variables: {"v0":"barId","v1":[{"firstName":"first","lastName":"last"},{"firstName":"first2","lastName":"last2"},{"firstName":"first3","lastName":"last3"}]} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml deleted file mode 100644 index e5cd2e7a4..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-arg-object.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: "basic hydration with static arg object" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID, fullName: FullName): Bar - } - type Bar { - id: ID - name: String - } - input FullName { - firstName: String - lastName: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { name: "id" value: "$source.id" } - { - name: "fullName" - value: { - firstName: "first" - lastName: "last" - } - } - ] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID, fullName: FullName): Bar - } - - input FullName { - firstName: String - lastName: String - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__id: id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__id": "barId" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID, $v1: FullName) { - barById(fullName: $v1, id: $v0) { - name - } - } - variables: {"v0":"barId","v1":{"firstName":"first","lastName":"last"}} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml deleted file mode 100644 index 218101799..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration-with-static-args.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: "basic hydration with static args" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__bar: __typename - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/basic-hydration.yml b/test/src/test/resources/fixtures/new hydration/basic-hydration.yml deleted file mode 100644 index 746dc8f7a..000000000 --- a/test/src/test/resources/fixtures/new hydration/basic-hydration.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: "basic hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml b/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml deleted file mode 100644 index b67929469..000000000 --- a/test/src/test/resources/fixtures/new hydration/batch-hydration-instruction-hook-returns-null.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: "batch hydration instruction hook returns null" -enabled: true -# language=GraphQL -overallSchema: - Issues: | - type Query { - issueById(id: ID!): Issue! - } - type Issue { - id: ID! - key: String - collaborators: [User] - @hydrated( - service: "Users" - field: "usersByIds" - arguments: [ - {name: "ids", value: "$source.collaboratorIds"} - ] - identifiedBy: "id" - ) - } - Users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - Issues: | - type Query { - issueById(id: ID!): Issue! - } - type Issue { - id: ID! - key: String - collaboratorIds: [ID] - } - Users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - query { - issueById(id: "10000") { - key - collaborators { - __typename - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__batch_hydration__collaborators: __typename - batch_hydration__collaborators__collaboratorIds: collaboratorIds - key - } - } - variables: {"v0":"10000"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "key": "GQLGW-1000", - "batch_hydration__collaborators__collaboratorIds": [ - "100", - "NULL/1", - "200" - ], - "__typename__batch_hydration__collaborators": "Issue" - } - } - } - - serviceName: "Users" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - usersByIds(ids: $v0) { - __typename - batch_hydration__collaborators__id: id - name - } - } - variables: {"v0":["100","200"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "__typename": "User", - "name": "John Doe", - "batch_hydration__collaborators__id": "100" - }, - { - "__typename": "User", - "name": "Joe", - "batch_hydration__collaborators__id": "200" - } - ] - } - } -# language=JSON -response: | - { - "data": { - "issueById": { - "key": "GQLGW-1000", - "collaborators": [ - { - "__typename": "User", - "name": "John Doe" - }, - null, - { - "__typename": "User", - "name": "Joe" - } - ] - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml b/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml deleted file mode 100644 index 1e1a38305..000000000 --- a/test/src/test/resources/fixtures/new hydration/batch-hydration-null-source-object.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: "batch hydration null source object" -enabled: true -# language=GraphQL -overallSchema: - issues: | - type Query { - myIssues(n: Int! = 10): [Issue] - } - type Issue { - title: String - assigneeId: ID - assignee: User - @hydrated( - service: "users" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.assigneeId"}] - inputIdentifiedBy: [{sourceId: "assigneeId", resultId: "id"}] - ) - } - users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - email: String - } -# language=GraphQL -underlyingSchema: - issues: | - type Query { - topIssue: Issue - myIssues(n: Int! = 10): [Issue] - } - type Issue { - title: String - assigneeId: ID - collaboratorIds: [ID!] - } - users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - email: String - } -# language=GraphQL -query: | - query { - myIssues { - title - assignee { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "issues" - request: - # language=GraphQL - query: | - { - myIssues { - __typename__batch_hydration__assignee: __typename - batch_hydration__assignee__assigneeId: assigneeId - title - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "myIssues": [ - { - "__typename__batch_hydration__assignee": "Issue", - "batch_hydration__assignee__assigneeId": "user-256", - "title": "Popular" - }, - null - ] - } - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - usersByIds(ids: $v0) { - batch_hydration__assignee__id: id - name - } - } - variables: {"v0":["user-256"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "batch_hydration__assignee__id": "user-256", - "name": "2^8" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "myIssues": [ - { - "title": "Popular", - "assignee": { - "name": "2^8" - } - }, - null - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml b/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml deleted file mode 100644 index 00d583d82..000000000 --- a/test/src/test/resources/fixtures/new hydration/batch-hydration-with-renamed-actor-field.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: "batch hydration with renamed actor field" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsByIdOverall(id: [ID]): [Bar] @renamed(from: "barsById") - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsByIdOverall" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - rename__barsByIdOverall__barsById: barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "data": { - "rename__barsByIdOverall__barsById": [ - { - "name": "Bar1", - "batch_hydration__bar__id": "barId1" - }, - { - "name": "Bar2", - "batch_hydration__bar__id": "barId2" - }, - { - "name": "Bar3", - "batch_hydration__bar__id": "barId3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name": "Bar1" - }, - { - "name": "Bar2" - }, - { - "name": "Bar3" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml deleted file mode 100644 index e2376c424..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-query-with-a-synthetic-field.yml +++ /dev/null @@ -1,223 +0,0 @@ -name: "batched hydration query with a synthetic field" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - users: UsersQuery - } - type UsersQuery { - foo: String - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - service1: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "service2" - field: "users.usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Query { - users: UsersQuery - } - - type User { - id: ID - name: String - } - - type UsersQuery { - foo: String - usersByIds(id: [ID]): [User] - } - service1: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "users": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "users": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml deleted file mode 100644 index 0dde32970..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-array-argument-values.yml +++ /dev/null @@ -1,210 +0,0 @@ -name: "batched hydration with default array argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: [String]): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors(test: [String] = ["Hello", "World"]): [User] @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "id" value: "$source.authorIds"} - {name: "test" value: "$argument.test"} - ] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: [String]): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [String], $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["Hello","World"],"v1":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [String], $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["Hello","World"],"v1":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml deleted file mode 100644 index 94e56bf1c..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-boolean-argument-values.yml +++ /dev/null @@ -1,210 +0,0 @@ -name: "batched hydration with default boolean argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: Boolean): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors(test: Boolean = true): [User] @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "id" value: "$source.authorIds"} - {name: "test" value: "$argument.test"} - ] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: Boolean): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: Boolean, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":true,"v1":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: Boolean, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":true,"v1":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml deleted file mode 100644 index 10664a8f9..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-int-argument-values.yml +++ /dev/null @@ -1,210 +0,0 @@ -name: "batched hydration with default int argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: Int): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors(test: Int = 42): [User] @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "id" value: "$source.authorIds"} - {name: "test" value: "$argument.test"} - ] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: Int): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: Int, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":42,"v1":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: Int, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":42,"v1":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml deleted file mode 100644 index afd8a5e35..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-null-argument-values.yml +++ /dev/null @@ -1,210 +0,0 @@ -name: "batched hydration with default null argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: String = "Hello World"): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors(test: String = null): [User] @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "id" value: "$source.authorIds"} - {name: "test" value: "$argument.test"} - ] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: String = "Hello World"): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":null,"v1":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":null,"v1":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml deleted file mode 100644 index a8f243016..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-object-argument-values.yml +++ /dev/null @@ -1,224 +0,0 @@ -name: "batched hydration with default object argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: Test): [User] - } - type User { - id: ID - } - input Test { - string: String = "Test" - int: Int = 42 - bool: Boolean = false - number: Int - echo: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors(test: Test = {echo: "Hello World"}): [User] @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "id" value: "$source.authorIds"} - {name: "test" value: "$argument.test"} - ] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: Test): [User] - } - - type User { - id: ID - } - input Test { - string: String = "Test" - int: Int = 42 - bool: Boolean = false - number: Int - echo: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: Test, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":{"echo":"Hello World"},"v1":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: Test, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":{"echo":"Hello World"},"v1":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml b/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml deleted file mode 100644 index 04df58401..000000000 --- a/test/src/test/resources/fixtures/new hydration/batched-hydration-with-default-string-argument-values.yml +++ /dev/null @@ -1,210 +0,0 @@ -name: "batched hydration with default string argument values" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: String): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors(test: String = "Hello World"): [User] @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "id" value: "$source.authorIds"} - {name: "test" value: "$argument.test"} - ] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID], test: String): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":"Hello World","v1":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: [ID]) { - usersByIds(id: $v1, test: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":"Hello World","v1":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml deleted file mode 100644 index ab8b824b0..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-flattened-arguments.yml +++ /dev/null @@ -1,223 +0,0 @@ -name: "batching of hydration list with flattened arguments" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authors.authorId"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - } - Issues: | - type Issue { - authorIds: [ID] - authors: [IssueUser] - id: ID - } - - type IssueUser { - authorId: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authors: authors { - authorId - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__authors__authors": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1" - }, - { - "batch_hydration__authors__authors": [ - { - "authorId": "USER-3" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-2" - }, - { - "batch_hydration__authors__authors": [ - { - "authorId": "USER-2" - }, - { - "authorId": "USER-4" - }, - { - "authorId": "USER-5" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml deleted file mode 100644 index 2f0ec8332..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition-2.yml +++ /dev/null @@ -1,186 +0,0 @@ -name: "batching of hydration list with partition 2" -enabled: true -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 90 - ) - } -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "site-1/user-1", - "site-2/user-2" - ], - "id": "issue-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - ], - "id": "issue-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "site-2/user-4" - ], - "id": "issue-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["site-1/user-1"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "site-1/user-1", - "batch_hydration__authors__id": "site-1/user-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["site-2/user-2","site-2/user-4"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "site-2/user-2", - "batch_hydration__authors__id": "site-2/user-2" - }, - { - "id": "site-2/user-4", - "batch_hydration__authors__id": "site-2/user-4" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "issue-1", - "authors": [ - { - "id": "site-1/user-1" - }, - { - "id": "site-2/user-2" - } - ] - }, - { - "id": "issue-2", - "authors": [ - ] - }, - { - "id": "issue-3", - "authors": [ - { - "id": "site-2/user-4" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml deleted file mode 100644 index 022f6284f..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list-with-partition.yml +++ /dev/null @@ -1,224 +0,0 @@ -name: "batching of hydration list with partition" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "CLOUD-ID-1/USER-1", - "CLOUD-ID-2/USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "CLOUD-ID-1/USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "CLOUD-ID-2/USER-4", - "CLOUD-ID-1/USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["CLOUD-ID-1/USER-1","CLOUD-ID-1/USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "CLOUD-ID-1/USER-1", - "batch_hydration__authors__id": "CLOUD-ID-1/USER-1" - }, - { - "id": "CLOUD-ID-1/USER-3", - "batch_hydration__authors__id": "CLOUD-ID-1/USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["CLOUD-ID-1/USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "CLOUD-ID-1/USER-5", - "batch_hydration__authors__id": "CLOUD-ID-1/USER-5" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["CLOUD-ID-2/USER-2","CLOUD-ID-2/USER-4"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "CLOUD-ID-2/USER-2", - "batch_hydration__authors__id": "CLOUD-ID-2/USER-2" - }, - { - "id": "CLOUD-ID-2/USER-4", - "batch_hydration__authors__id": "CLOUD-ID-2/USER-4" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "CLOUD-ID-1/USER-1" - }, - { - "id": "CLOUD-ID-2/USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "CLOUD-ID-1/USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "CLOUD-ID-2/USER-4" - }, - { - "id": "CLOUD-ID-1/USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml b/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml deleted file mode 100644 index a8788d61f..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching-of-hydration-list.yml +++ /dev/null @@ -1,204 +0,0 @@ -name: "batching of hydration list" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - } - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - }, - { - "id": "USER-3", - "batch_hydration__authors__id": "USER-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-4", - "batch_hydration__authors__id": "USER-4" - }, - { - "id": "USER-5", - "batch_hydration__authors__id": "USER-5" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2" - }, - { - "id": "USER-4" - }, - { - "id": "USER-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml deleted file mode 100644 index bac338cfd..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-absent-source-input.yml +++ /dev/null @@ -1,215 +0,0 @@ -name: "batching absent source input" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [Activity] - } - union ActivityContent = Issue | Comment - type Activity { - id: ID! - contentId: ID - content: ActivityContent - @hydrated( - service: "comments" - field: "commentsByIds" - arguments: [ - {name: "ids" value: "$source.contentId"} - ] - ) - @hydrated( - service: "issues" - field: "issuesByIds" - arguments: [ - {name: "ids" value: "$source.contentId"} - ] - ) - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - activity: | - type Query { - activity: [Activity] - } - type Activity { - id: ID! - contentId: ID - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -query: | - { - activity { - content { - __typename - ... on Issue { - id - title - } - ... on Comment { - id - content - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - __typename__batch_hydration__content: __typename - batch_hydration__content__contentId: contentId - batch_hydration__content__contentId: contentId - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "__typename__batch_hydration__content": "Activity" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "comment/9001" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "issue/1234" - } - ] - }, - "extensions": {} - } - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - issuesByIds(ids: $v0) { - __typename - id - batch_hydration__content__id: id - title - } - } - variables: {"v0":["issue/1234"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "__typename": "Issue", - "id": "issue/1234", - "batch_hydration__content__id": "issue/1234", - "title": "One Two Three Four" - } - ] - }, - "extensions": {} - } - - serviceName: "comments" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - commentsByIds(ids: $v0) { - __typename - content - id - batch_hydration__content__id: id - } - } - variables: {"v0":["comment/9001"]} - # language=JSON - response: |- - { - "data": { - "commentsByIds": [ - { - "__typename": "Comment", - "id": "comment/9001", - "batch_hydration__content__id": "comment/9001", - "content": "It's over 9000" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activity": [ - { - "content": null - }, - { - "content": null - }, - { - "content": { - "__typename": "Comment", - "id": "comment/9001", - "content": "It's over 9000" - } - }, - { - "content": { - "__typename": "Issue", - "id": "issue/1234", - "title": "One Two Three Four" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml deleted file mode 100644 index b8f6e9a56..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-accepts-true-condition-after-a-false-condition.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: "batching conditional hydration accepts true condition after a false condition" -enabled: true -overallSchema: - service2: | - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: [Bars] - @hydrated( - service: "service2" - field: "barsById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "thatType" } - } - } - ) - @hydrated( - service: "service2" - field: "othersById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "thisType" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - service1: | - type Foo { - barIds: [ID] - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barIds: barIds - batch_hydration__bar__barIds: barIds - batch_hydration__bar__type: type - batch_hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barIds": ["barId1", "barId2"], - "batch_hydration__bar__type": "thisType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - othersById(ids: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2"]} - # language=JSON - response: |- - { - "data": { - "othersById": [{ - "batch_hydration__bar__id": "barId1", - "name": "Bar1" - }, { - "batch_hydration__bar__id": "barId2", - "name": "Bar2" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name":"Bar1" - }, - { - "name":"Bar2" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml deleted file mode 100644 index fbb4dd43b..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-in-abstract-type.yml +++ /dev/null @@ -1,315 +0,0 @@ -name: "batching conditional hydration in abstract type" -enabled: true -# language=GraphQL -overallSchema: - monolith: | - type Query { - activity: [IActivity] - issuesByIds(ids: [ID!]!): [Issue!] - commentsByIds(ids: [ID!]!): [Comment!] - } - interface IActivity { - content: [ActivityContent] - } - union ActivityContent = Issue | Comment - type Activity implements IActivity { - id: ID! - content: [ActivityContent] - @hydrated( - service: "monolith" - field: "commentsByIds" - arguments: [ - {name: "ids" value: "$source.contentIds"} - ] - ) - @hydrated( - service: "monolith" - field: "issuesByIds" - arguments: [ - {name: "ids" value: "$source.contentIds"} - ] - ) - } - type SingleActivity implements IActivity { - id: ID! - content: [ActivityContent] - @hydrated( - service: "monolith" - field: "issuesByIds" - arguments: [ - {name: "ids" value: "$source.contentId"} - ] - ) - @hydrated( - service: "monolith" - field: "commentsByIds" - arguments: [ - {name: "ids" value: "$source.contentId"} - ] - ) - } - type Issue { - id: ID! - title: String - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -underlyingSchema: - monolith: | - type Query { - activity: [IActivity] - commentsByIds(ids: [ID!]!): [Comment!] - issuesByIds(ids: [ID!]!): [Issue!] - } - interface IActivity { - content: [ActivityContent] - } - union ActivityContent = Issue | Comment - type Activity implements IActivity { - id: ID! - content: [ActivityContent] - contentIds: [ID!] - } - type SingleActivity implements IActivity { - id: ID! - content: [ActivityContent] - contentId: ID! - } - type Issue { - id: ID! - title: String - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -query: | - { - activity { - content { - __typename - ... on Issue { - id - title - } - ... on Comment { - id - content - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "monolith" - request: - # language=GraphQL - query: | - { - activity { - __typename__batch_hydration__content: __typename - ... on Activity { - batch_hydration__content__contentIds: contentIds - batch_hydration__content__contentIds: contentIds - } - ... on SingleActivity { - batch_hydration__content__contentId: contentId - batch_hydration__content__contentId: contentId - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/4000", - "comment/5000", - "comment/6000" - ] - }, - { - "__typename__batch_hydration__content": "SingleActivity", - "batch_hydration__content__contentId": "issue/8080" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "comment/1234", - "comment/9001" - ] - }, - { - "__typename__batch_hydration__content": "SingleActivity", - "batch_hydration__content__contentId": "issue/7496" - } - ] - }, - "extensions": {} - } - - serviceName: "monolith" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - issuesByIds(ids: $v0) { - __typename - id - batch_hydration__content__id: id - title - } - } - variables: {"v0":["issue/4000"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "__typename": "Issue", - "id": "issue/4000", - "batch_hydration__content__id": "issue/4000", - "title": "Four Thousand" - } - ] - }, - "extensions": {} - } - - serviceName: "monolith" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - issuesByIds(ids: $v0) { - __typename - id - batch_hydration__content__id: id - title - } - } - variables: {"v0":["issue/8080","issue/7496"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "__typename": "Issue", - "id": "issue/7496", - "batch_hydration__content__id": "issue/7496", - "title": "Seven Four Nine Six" - } - ] - }, - "extensions": {} - } - - serviceName: "monolith" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - commentsByIds(ids: $v0) { - __typename - content - id - batch_hydration__content__id: id - } - } - variables: {"v0":["comment/5000","comment/6000","comment/1234","comment/9001"]} - # language=JSON - response: |- - { - "data": { - "commentsByIds": [ - { - "__typename": "Comment", - "id": "comment/5000", - "batch_hydration__content__id": "comment/5000", - "content": "Five Thousand" - }, - { - "__typename": "Comment", - "id": "comment/6000", - "batch_hydration__content__id": "comment/6000", - "content": "Six Thousand" - }, - { - "__typename": "Comment", - "id": "comment/9001", - "batch_hydration__content__id": "comment/9001", - "content": "It's over 9000" - }, - { - "__typename": "Comment", - "id": "comment/1234", - "batch_hydration__content__id": "comment/1234", - "content": "One Two Three Four" - } - ] - }, - "extensions": {} - } -# language=JSON -response: | - { - "data": { - "activity": [ - { - "content": [ - { - "__typename": "Issue", - "id": "issue/4000", - "title": "Four Thousand" - }, - { - "__typename": "Comment", - "id": "comment/5000", - "content": "Five Thousand" - }, - { - "__typename": "Comment", - "id": "comment/6000", - "content": "Six Thousand" - } - ] - }, - { - "content": [ - null - ] - }, - { - "content": [ - { - "__typename": "Comment", - "id": "comment/1234", - "content": "One Two Three Four" - }, - { - "__typename": "Comment", - "id": "comment/9001", - "content": "It's over 9000" - } - ] - }, - { - "content": [ - { - "__typename": "Issue", - "id": "issue/7496", - "title": "Seven Four Nine Six" - } - ] - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml deleted file mode 100644 index 010557473..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-list-condition-field.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: "batching conditional hydration with list condition field" -enabled: true -overallSchema: - service2: | - type Query { - barsById(ids: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - barIds: [ID] @hidden - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "barIds" - predicate: { equals: "barId2" } - } - } - ) - } -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(ids: [ID]): [Bar] - } - service1: | - type Foo { - barIds: [ID] - id: ID - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barIds: barIds - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barIds": ["barId1", "barId2", "barId3"] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(ids: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId2"]} - # language=JSON - response: |- - { - "data": { - "barsById": [{ - "batch_hydration__bar__id": "barId2", - "name": "Bar2" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [null, {"name":"Bar2"}, null] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml deleted file mode 100644 index 96aced9b3..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-with-multiple-true-conditions-takes-first.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: "batching conditional hydration with multiple true conditions takes first" -enabled: true -overallSchema: - service2: | - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: [Bars] - @hydrated( - service: "service2" - field: "barsById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "this" } - } - } - ) - @hydrated( - service: "service2" - field: "othersById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "thisType" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - service1: | - type Foo { - barIds: [ID] - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barIds: barIds - batch_hydration__bar__barIds: barIds - batch_hydration__bar__type: type - batch_hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barIds": ["barId1", "barId2"], - "batch_hydration__bar__type": "thisType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(ids: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2"]} - # language=JSON - response: |- - { - "data": { - "barsById": [{ - "batch_hydration__bar__id": "barId1", - "name": "Bar1" - }, { - "batch_hydration__bar__id": "barId2", - "name": "Bar2" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name":"Bar1" - }, - { - "name":"Bar2" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml deleted file mode 100644 index 5900bf364..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-int-type.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: "batching conditional hydration works with int type" -enabled: true -overallSchema: - service2: | - type Query { - barsById(ids: [Int]): [Bar] - } - type Bar { - id: Int - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: Int - barIds: [Int] @hidden - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "barIds" - predicate: { equals: 2 } - } - } - ) - } -underlyingSchema: - service2: | - type Bar { - id: Int - name: String - } - - type Query { - barsById(ids: [Int]): [Bar] - } - service1: | - type Foo { - barIds: [Int] - id: Int - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barIds: barIds - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barIds": [1, 2, 3] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [Int]) { - barsById(ids: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":[2]} - # language=JSON - response: |- - { - "data": { - "barsById": [{ - "batch_hydration__bar__id": 2, - "name": "Bar2" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [null, {"name":"Bar2"}, null] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml deleted file mode 100644 index 14eb3b3ef..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-matches-condition.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: "batching conditional hydration works with matches condition" -enabled: true -overallSchema: - service2: | - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: [Bars] - @hydrated( - service: "service2" - field: "barsById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { matches: "that[a-zA-Z]+" } - } - } - ) - @hydrated( - service: "service2" - field: "othersById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { matches: "this[a-zA-Z]+" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - service1: | - type Foo { - barIds: [ID] - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barIds: barIds - batch_hydration__bar__barIds: barIds - batch_hydration__bar__type: type - batch_hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barIds": ["barId1", "barId2"], - "batch_hydration__bar__type": "thisType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - othersById(ids: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2"]} - # language=JSON - response: |- - { - "data": { - "othersById": [{ - "batch_hydration__bar__id": "barId1", - "name": "Bar1" - }, { - "batch_hydration__bar__id": "barId2", - "name": "Bar2" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name":"Bar1" - }, - { - "name":"Bar2" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml deleted file mode 100644 index c37b9ccf2..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-conditional-hydration-works-with-starts-with-condition.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: "batching conditional hydration works with startsWith condition" -enabled: true -overallSchema: - service2: | - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: [Bars] - @hydrated( - service: "service2" - field: "barsById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "that" } - } - } - ) - @hydrated( - service: "service2" - field: "othersById" - arguments: [ - { - name: "ids" - value: "$source.barIds" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "this" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(ids: [ID]): [Bar] - othersById(ids: [ID]): [Bar] - } - service1: | - type Foo { - barIds: [ID] - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barIds: barIds - batch_hydration__bar__barIds: barIds - batch_hydration__bar__type: type - batch_hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barIds": ["barId1", "barId2"], - "batch_hydration__bar__type": "thisType" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - othersById(ids: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2"]} - # language=JSON - response: |- - { - "data": { - "othersById": [{ - "batch_hydration__bar__id": "barId1", - "name": "Bar1" - }, { - "batch_hydration__bar__id": "barId2", - "name": "Bar2" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name":"Bar1" - }, - { - "name":"Bar2" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml deleted file mode 100644 index 3624dbcb6..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-multiple-source-ids-going-to-different-services.yml +++ /dev/null @@ -1,300 +0,0 @@ -name: "batching multiple source ids going to different services" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [Activity] - } - union ActivityContent = Issue | Comment - type Activity { - id: ID! - contentIds: [ID!]! - content: [ActivityContent] - @hydrated( - service: "comments" - field: "commentsByIds" - arguments: [ - {name: "ids" value: "$source.contentIds"} - ] - ) - @hydrated( - service: "issues" - field: "issuesByIds" - arguments: [ - {name: "ids" value: "$source.contentIds"} - ] - ) - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - activity: | - type Query { - activity: [Activity] - } - type Activity { - id: ID! - contentIds: [ID!]! - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -query: | - { - activity { - content { - __typename - ... on Issue { - id - title - } - ... on Comment { - id - content - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - __typename__batch_hydration__content: __typename - batch_hydration__content__contentIds: contentIds - batch_hydration__content__contentIds: contentIds - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/4000", - "comment/5000", - "comment/6000" - ] - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/8080" - ] - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/7496", - "comment/9001" - ] - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/1234", - "comment/1234" - ] - } - ] - }, - "extensions": {} - } - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - issuesByIds(ids: $v0) { - __typename - id - batch_hydration__content__id: id - title - } - } - variables: {"v0":["issue/4000","issue/8080","issue/7496","issue/1234"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "__typename": "Issue", - "id": "issue/4000", - "batch_hydration__content__id": "issue/4000", - "title": "Four Thousand" - }, - { - "__typename": "Issue", - "id": "issue/8080", - "batch_hydration__content__id": "issue/8080", - "title": "Eighty Eighty" - }, - { - "__typename": "Issue", - "id": "issue/7496", - "batch_hydration__content__id": "issue/7496", - "title": "Seven Four Nine Six" - }, - { - "__typename": "Issue", - "id": "issue/1234", - "batch_hydration__content__id": "issue/1234", - "title": "One Two Three Four" - } - ] - }, - "extensions": {} - } - - serviceName: "comments" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - commentsByIds(ids: $v0) { - __typename - content - id - batch_hydration__content__id: id - } - } - variables: {"v0":["comment/5000","comment/6000","comment/9001","comment/1234"]} - # language=JSON - response: |- - { - "data": { - "commentsByIds": [ - { - "__typename": "Comment", - "id": "comment/5000", - "batch_hydration__content__id": "comment/5000", - "content": "Five Thousand" - }, - { - "__typename": "Comment", - "id": "comment/6000", - "batch_hydration__content__id": "comment/6000", - "content": "Six Thousand" - }, - { - "__typename": "Comment", - "id": "comment/9001", - "batch_hydration__content__id": "comment/9001", - "content": "It's over 9000" - }, - { - "__typename": "Comment", - "id": "comment/1234", - "batch_hydration__content__id": "comment/1234", - "content": "One Two Three Four" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activity": [ - { - "content": [ - { - "__typename": "Issue", - "id": "issue/4000", - "title": "Four Thousand" - }, - { - "__typename": "Comment", - "id": "comment/5000", - "content": "Five Thousand" - }, - { - "__typename": "Comment", - "id": "comment/6000", - "content": "Six Thousand" - } - ] - }, - { - "content": [ - { - "__typename": "Issue", - "id": "issue/8080", - "title": "Eighty Eighty" - } - ] - }, - { - "content": [ - { - "__typename": "Issue", - "id": "issue/7496", - "title": "Seven Four Nine Six" - }, - { - "__typename": "Comment", - "id": "comment/9001", - "content": "It's over 9000" - } - ] - }, - { - "content": [ - { - "__typename": "Issue", - "id": "issue/1234", - "title": "One Two Three Four" - }, - { - "__typename": "Comment", - "id": "comment/1234", - "content": "One Two Three Four" - } - ] - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml deleted file mode 100644 index b92df9f13..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-no-source-inputs.yml +++ /dev/null @@ -1,248 +0,0 @@ -name: "batching no source inputs" -enabled: true -# language=GraphQL -overallSchema: - activity: | - type Query { - activity: [Activity] - } - union ActivityContent = Issue | Comment - type Activity { - id: ID! - contentIds: [ID!]! - content: [ActivityContent] - @hydrated( - service: "comments" - field: "commentsByIds" - arguments: [ - {name: "ids" value: "$source.contentIds"} - ] - ) - @hydrated( - service: "issues" - field: "issuesByIds" - arguments: [ - {name: "ids" value: "$source.contentIds"} - ] - ) - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - activity: | - type Query { - activity: [Activity] - } - type Activity { - id: ID! - contentIds: [ID!]! - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -query: | - { - activity { - content { - __typename - ... on Issue { - id - title - } - ... on Comment { - id - content - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - __typename__batch_hydration__content: __typename - batch_hydration__content__contentIds: contentIds - batch_hydration__content__contentIds: contentIds - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [] - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [] - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/7496", - "comment/9001" - ] - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentIds": [ - "issue/1234", - "comment/1234" - ] - } - ] - }, - "extensions": {} - } - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - issuesByIds(ids: $v0) { - __typename - id - batch_hydration__content__id: id - title - } - } - variables: {"v0":["issue/7496","issue/1234"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "__typename": "Issue", - "id": "issue/7496", - "batch_hydration__content__id": "issue/7496", - "title": "Seven Four Nine Six" - }, - { - "__typename": "Issue", - "id": "issue/1234", - "batch_hydration__content__id": "issue/1234", - "title": "One Two Three Four" - } - ] - }, - "extensions": {} - } - - serviceName: "comments" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - commentsByIds(ids: $v0) { - __typename - content - id - batch_hydration__content__id: id - } - } - variables: {"v0":["comment/9001","comment/1234"]} - # language=JSON - response: |- - { - "data": { - "commentsByIds": [ - { - "__typename": "Comment", - "id": "comment/1234", - "batch_hydration__content__id": "comment/1234", - "content": "One Two Three Four" - }, - { - "__typename": "Comment", - "id": "comment/9001", - "batch_hydration__content__id": "comment/9001", - "content": "It's over 9000" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activity": [ - { - "content": [] - }, - { - "content": [] - }, - { - "content": [ - { - "__typename": "Issue", - "id": "issue/7496", - "title": "Seven Four Nine Six" - }, - { - "__typename": "Comment", - "id": "comment/9001", - "content": "It's over 9000" - } - ] - }, - { - "content": [ - { - "__typename": "Issue", - "id": "issue/1234", - "title": "One Two Three Four" - }, - { - "__typename": "Comment", - "id": "comment/1234", - "content": "One Two Three Four" - } - ] - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml b/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml deleted file mode 100644 index 0f0c0a33d..000000000 --- a/test/src/test/resources/fixtures/new hydration/batching/batching-single-source-id.yml +++ /dev/null @@ -1,237 +0,0 @@ -name: "batching single source id" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - activity: | - type Query { - activity: [Activity] - } - union ActivityContent = Issue | Comment - type Activity { - id: ID! - contentId: ID! - content: ActivityContent - @hydrated( - service: "comments" - field: "commentsByIds" - arguments: [ - {name: "ids" value: "$source.contentId"} - ] - ) - @hydrated( - service: "issues" - field: "issuesByIds" - arguments: [ - {name: "ids" value: "$source.contentId"} - ] - ) - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - activity: | - type Query { - activity: [Activity] - } - type Activity { - id: ID! - contentId: ID! - } - # language=GraphQL - issues: | - type Query { - issuesByIds(ids: [ID!]!): [Issue!] - } - type Issue { - id: ID! - title: String - } - # language=GraphQL - comments: | - type Query { - commentsByIds(ids: [ID!]!): [Comment!] - } - type Comment { - id: ID! - content: String - } -# language=GraphQL -query: | - { - activity { - content { - __typename - ... on Issue { - id - title - } - ... on Comment { - id - content - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "activity" - request: - # language=GraphQL - query: | - { - activity { - __typename__batch_hydration__content: __typename - batch_hydration__content__contentId: contentId - batch_hydration__content__contentId: contentId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activity": [ - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "issue/4000" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "issue/8080" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "issue/7496" - }, - { - "__typename__batch_hydration__content": "Activity", - "batch_hydration__content__contentId": "comment/1234" - } - ] - }, - "extensions": {} - } - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - issuesByIds(ids: $v0) { - __typename - id - batch_hydration__content__id: id - title - } - } - variables: {"v0":["issue/4000","issue/8080","issue/7496"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "__typename": "Issue", - "id": "issue/4000", - "batch_hydration__content__id": "issue/4000", - "title": "Four Thousand" - }, - { - "__typename": "Issue", - "id": "issue/8080", - "batch_hydration__content__id": "issue/8080", - "title": "Eighty Eighty" - }, - { - "__typename": "Issue", - "id": "issue/7496", - "batch_hydration__content__id": "issue/7496", - "title": "Seven Four Nine Six" - } - ] - }, - "extensions": {} - } - - serviceName: "comments" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - commentsByIds(ids: $v0) { - __typename - content - id - batch_hydration__content__id: id - } - } - variables: {"v0":["comment/1234"]} - # language=JSON - response: |- - { - "data": { - "commentsByIds": [ - { - "__typename": "Comment", - "id": "comment/1234", - "batch_hydration__content__id": "comment/1234", - "content": "One Two Three Four" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activity": [ - { - "content": { - "__typename": "Issue", - "id": "issue/4000", - "title": "Four Thousand" - } - }, - { - "content": { - "__typename": "Issue", - "id": "issue/8080", - "title": "Eighty Eighty" - } - }, - { - "content": { - "__typename": "Issue", - "id": "issue/7496", - "title": "Seven Four Nine Six" - } - }, - { - "content": { - "__typename": "Comment", - "id": "comment/1234", - "content": "One Two Three Four" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml deleted file mode 100644 index 1685dfc1a..000000000 --- a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration-for-specific-service.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: "can generate legacy operation name on batch hydration for specific service" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query nadel_2_service2($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - operationName: "nadel_2_service2" - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "Bar1", - "batch_hydration__bar__id": "barId1" - }, - { - "name": "Bar2", - "batch_hydration__bar__id": "barId2" - }, - { - "name": "Bar3", - "batch_hydration__bar__id": "barId3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name": "Bar1" - }, - { - "name": "Bar2" - }, - { - "name": "Bar3" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml deleted file mode 100644 index 0bf4995db..000000000 --- a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-batch-hydration.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: "can generate legacy operation name on batch hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - query nadel_2_service1 { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - operationName: "nadel_2_service1" - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query nadel_2_service2($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - operationName: "nadel_2_service2" - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "Bar1", - "batch_hydration__bar__id": "barId1" - }, - { - "name": "Bar2", - "batch_hydration__bar__id": "barId2" - }, - { - "name": "Bar3", - "batch_hydration__bar__id": "barId3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name": "Bar1" - }, - { - "name": "Bar2" - }, - { - "name": "Bar3" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml b/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml deleted file mode 100644 index d5703eb32..000000000 --- a/test/src/test/resources/fixtures/new hydration/can-generate-legacy-operation-name-on-hydration.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: "can generate legacy operation name on hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query TestFoo { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - query nadel_2_service1_TestFoo { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - operationName: "nadel_2_service1_TestFoo" - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query nadel_2_service2_TestFoo($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - operationName: "nadel_2_service2_TestFoo" - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml deleted file mode 100644 index 2d3726b3a..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-doesnt-use-all-input-fields-in-the-input-identified-by-argument.yml +++ /dev/null @@ -1,229 +0,0 @@ -name: "complex identified by doesnt use all input fields in the inputIdentifiedBy argument" -enabled: true -# language=GraphQL -overallSchema: - Activity: | - type Query { - activities: [Activity] - } - - type Activity { - id: ID - issue: Issue @hydrated( - service: "Issue" - field: "issues" - arguments: [{name: "issuesInput" value: "$source.context.issueHydrationInput"}] - inputIdentifiedBy: [ - {sourceId: "context.issueHydrationInput.id" resultId: "issueId"} - ] - ) - } - Issue: | - type Query { - issues(issuesInput: [IssueInput!]): [Issue] - } - - type Issue { - issueId: ID - description: String - } - - input IssueInput { - id: ID! - site: ID! - } -# language=GraphQL -underlyingSchema: - Activity: | - type Query { - activities: [Activity] - } - - type Activity { - id: ID - context: HydrationContext - } - - type HydrationContext { - issueHydrationInput: IssueHydrationInput - } - - type IssueHydrationInput { - id: ID! - site: ID! - } - Issue: | - type Query { - issues(issuesInput: [IssueInput!]): [Issue] - } - - type Issue { - issueId: ID - description: String - } - - input IssueInput { - id: ID! - site: ID! - } -# language=GraphQL -query: | - query { - activities { - id - issue { - issueId - description - } - } - } -variables: { } -serviceCalls: - - serviceName: "Activity" - request: - # language=GraphQL - query: | - { - activities { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__context: context { - issueHydrationInput { - id - } - } - batch_hydration__issue__context: context { - issueHydrationInput { - site - } - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activities": [ - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-0", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-0" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-1", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-1" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-2", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-2" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-3", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-3" - } - ] - }, - "extensions": {} - } - - serviceName: "Issue" - request: - # language=GraphQL - query: | - query ($v0: [IssueInput!]) { - issues(issuesInput: $v0) { - description - issueId - batch_hydration__issue__issueId: issueId - } - } - variables: {"v0":[{"id":"ISSUE-0","site":"CLOUD-0"},{"id":"ISSUE-1","site":"CLOUD-0"},{"id":"ISSUE-2","site":"CLOUD-0"},{"id":"ISSUE-3","site":"CLOUD-0"}]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__issue__issueId": "ISSUE-0", - "issueId": "ISSUE-0", - "description": "fix A" - }, - { - "batch_hydration__issue__issueId": "ISSUE-1", - "issueId": "ISSUE-1", - "description": "fix B" - }, - { - "batch_hydration__issue__issueId": "ISSUE-2", - "issueId": "ISSUE-2", - "description": "fix C" - }, - { - "batch_hydration__issue__issueId": "ISSUE-3", - "issueId": "ISSUE-3", - "description": "fix D" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activities": [ - { - "id": "ACTIVITY-0", - "issue": { - "issueId": "ISSUE-0", - "description": "fix A" - } - }, - { - "id": "ACTIVITY-1", - "issue": { - "issueId": "ISSUE-1", - "description": "fix B" - } - }, - { - "id": "ACTIVITY-2", - "issue": { - "issueId": "ISSUE-2", - "description": "fix C" - } - }, - { - "id": "ACTIVITY-3", - "issue": { - "issueId": "ISSUE-3", - "description": "fix D" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml deleted file mode 100644 index c7e8aba69..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-hydration-batching-returns-null-batch.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: "complex identified by hydration batching returns null batch" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] @hydrated( - service: "service2" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - inputIdentifiedBy: [{sourceId: "barId" resultId: "id"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - null, - null, - null - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml deleted file mode 100644 index c4be05854..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations-and-a-deep-rename.yml +++ /dev/null @@ -1,271 +0,0 @@ -name: "complex identified by uses same source for 2 hydrations and a deep rename" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foos: [Foo] - details(detailIds: [ID]): [Detail] - issues(issueIds: [ID]): [Issue] - } - type Foo { - renamedField: String @renamed(from: "issue.field") - issue: Issue @hydrated( - service: "Foo" - field: "issues" - arguments: [{name: "issueIds" value: "$source.fooId"}] - inputIdentifiedBy: [{sourceId: "fooId" resultId: "issueId"}] - batchSize: 2 - ) - detail: Detail @hydrated( - service: "Foo" - field: "details" - arguments: [{name: "detailIds" value: "$source.fooId"}] - inputIdentifiedBy: [{sourceId: "fooId" resultId: "detailId"}] - batchSize: 2 - ) - } - type Detail { - detailId: ID! - name: String - } - type Issue { - fooId: ID - field: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Detail { - detailId: ID! - name: String - } - - type Foo { - field: String - fooId: ID - issue: Issue - } - - type Issue { - issueId: ID - field: String - fooId: ID - } - - type Query { - details(detailIds: [ID]): [Detail] - foos: [Foo] - issues(issueIds: [ID]): [Issue] - } -# language=GraphQL -query: | - query { - foos { - renamedField - issue { - field - } - detail { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query { - foos { - __typename__deep_rename__renamedField: __typename - __typename__batch_hydration__issue: __typename - __typename__batch_hydration__detail: __typename - batch_hydration__issue__fooId: fooId - batch_hydration__detail__fooId: fooId - deep_rename__renamedField__issue: issue { - field - } - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "__typename__deep_rename__renamedField": "Foo", - "__typename__batch_hydration__issue": "Foo", - "__typename__batch_hydration__detail": "Foo", - "batch_hydration__issue__fooId": "Foo-1", - "batch_hydration__detail__fooId": "Foo-1", - "deep_rename__renamedField__issue": { - "field": "hmm-1" - } - }, - { - "__typename__deep_rename__renamedField": "Foo", - "__typename__batch_hydration__issue": "Foo", - "__typename__batch_hydration__detail": "Foo", - "batch_hydration__issue__fooId": "Foo-2", - "batch_hydration__detail__fooId": "Foo-2", - "deep_rename__renamedField__issue": { - "field": "hmm-2" - } - }, - { - "__typename__deep_rename__renamedField": "Foo", - "__typename__batch_hydration__issue": "Foo", - "__typename__batch_hydration__detail": "Foo", - "batch_hydration__issue__fooId": "Foo-3", - "batch_hydration__detail__fooId": "Foo-4", - "deep_rename__renamedField__issue": { - "field": "hmm-3" - } - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - issues(issueIds: $v0) { - field - batch_hydration__issue__issueId: issueId - } - } - variables: {"v0":["Foo-1","Foo-2"]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__issue__issueId": "Foo-1", - "field": "field_name" - }, - { - "batch_hydration__issue__issueId": "Foo-2", - "field": "field_name-2" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - issues(issueIds: $v0) { - field - batch_hydration__issue__issueId: issueId - } - } - variables: {"v0":["Foo-3"]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__issue__issueId": "Foo-3", - "field": "field-3" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - details(detailIds: $v0) { - batch_hydration__detail__detailId: detailId - name - } - } - variables: {"v0":["Foo-1","Foo-2"]} - # language=JSON - response: |- - { - "data": { - "details": [ - { - "batch_hydration__detail__detailId": "Foo-2", - "name": "Foo 2 Electric Boogaloo" - }, - { - "batch_hydration__detail__detailId": "Foo-1", - "name": "apple" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - details(detailIds: $v0) { - batch_hydration__detail__detailId: detailId - name - } - } - variables: {"v0":["Foo-4"]} - # language=JSON - response: |- - { - "data": { - "details": [ - { - "batch_hydration__detail__detailId": "Foo-4", - "name": "Four Apples" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "renamedField": "hmm-1", - "issue": { - "field": "field_name" - }, - "detail": { - "name": "apple" - } - }, - { - "renamedField": "hmm-2", - "issue": { - "field": "field_name-2" - }, - "detail": { - "name": "Foo 2 Electric Boogaloo" - } - }, - { - "renamedField": "hmm-3", - "issue": { - "field": "field-3" - }, - "detail": { - "name": "Four Apples" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml deleted file mode 100644 index e89c2e239..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-uses-same-source-for-2-hydrations.yml +++ /dev/null @@ -1,250 +0,0 @@ -name: "complex identified by uses same source for 2 hydrations" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foos: [Foo] - details(detailIds: [ID]): [Detail] - issues(issueIds: [ID]): [Issue] - } - type Foo { - issue: Issue @hydrated( - service: "Foo" - field: "issues" - arguments: [{name: "issueIds" value: "$source.fooId"}] - inputIdentifiedBy: [{sourceId: "fooId" resultId: "issueId"}] - batchSize: 2 - ) - detail: Detail @hydrated( - service: "Foo" - field: "details" - arguments: [{name: "detailIds" value: "$source.fooId"}] - inputIdentifiedBy: [{sourceId: "fooId" resultId: "detailId"}] - batchSize: 2 - ) - } - type Detail { - detailId: ID! - name: String - } - type Issue { - fooId: ID - field: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Detail { - detailId: ID! - name: String - } - - type Foo { - field: String - fooId: ID - issue: Issue - } - - type Issue { - issueId: ID - field: String - fooId: ID - } - - type Query { - details(detailIds: [ID]): [Detail] - foos: [Foo] - issues(issueIds: [ID]): [Issue] - } -# language=GraphQL -query: | - query { - foos { - issue { - field - } - detail { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query { - foos { - __typename__batch_hydration__issue: __typename - __typename__batch_hydration__detail: __typename - batch_hydration__issue__fooId: fooId - batch_hydration__detail__fooId: fooId - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "__typename__batch_hydration__issue": "Foo", - "__typename__batch_hydration__detail": "Foo", - "batch_hydration__issue__fooId": "Foo-1", - "batch_hydration__detail__fooId": "Foo-1" - }, - { - "__typename__batch_hydration__issue": "Foo", - "__typename__batch_hydration__detail": "Foo", - "batch_hydration__issue__fooId": "Foo-2", - "batch_hydration__detail__fooId": "Foo-2" - }, - { - "__typename__batch_hydration__issue": "Foo", - "__typename__batch_hydration__detail": "Foo", - "batch_hydration__issue__fooId": "Foo-3", - "batch_hydration__detail__fooId": "Foo-4" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - issues(issueIds: $v0) { - field - batch_hydration__issue__issueId: issueId - } - } - variables: {"v0":["Foo-1","Foo-2"]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__issue__issueId": "Foo-1", - "field": "field_name" - }, - { - "batch_hydration__issue__issueId": "Foo-2", - "field": "field_name-2" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - issues(issueIds: $v0) { - field - batch_hydration__issue__issueId: issueId - } - } - variables: {"v0":["Foo-3"]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__issue__issueId": "Foo-3", - "field": "field-3" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - details(detailIds: $v0) { - batch_hydration__detail__detailId: detailId - name - } - } - variables: {"v0":["Foo-1","Foo-2"]} - # language=JSON - response: |- - { - "data": { - "details": [ - { - "batch_hydration__detail__detailId": "Foo-2", - "name": "Foo 2 Electric Boogaloo" - }, - { - "batch_hydration__detail__detailId": "Foo-1", - "name": "apple" - } - ] - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - details(detailIds: $v0) { - batch_hydration__detail__detailId: detailId - name - } - } - variables: {"v0":["Foo-4"]} - # language=JSON - response: |- - { - "data": { - "details": [ - { - "batch_hydration__detail__detailId": "Foo-4", - "name": "Four Apples" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "issue": { - "field": "field_name" - }, - "detail": { - "name": "apple" - } - }, - { - "issue": { - "field": "field_name-2" - }, - "detail": { - "name": "Foo 2 Electric Boogaloo" - } - }, - { - "issue": { - "field": "field-3" - }, - "detail": { - "name": "Four Apples" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml deleted file mode 100644 index 243f7a4a0..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-indexed-hydration.yml +++ /dev/null @@ -1,222 +0,0 @@ -name: "complex identified by with indexed hydration" -enabled: true -# language=GraphQL -overallSchema: - Activity: | - type Query { - activities: [Activity] - } - - type Activity { - id: ID - issue: Issue @hydrated( - service: "Issue" - field: "issues" - arguments: [{name: "issuesInput" value: "$source.context.issueHydrationInput"}] - indexed: true - ) - } - Issue: | - type Query { - issues(issuesInput: [IssueInput!]): [Issue] - } - - type Issue { - issueId: ID - description: String - } - - input IssueInput { - id: ID! - site: ID! - } -# language=GraphQL -underlyingSchema: - Activity: | - type Query { - activities: [Activity] - } - - type Activity { - id: ID - context: HydrationContext - } - - type HydrationContext { - issueHydrationInput: IssueHydrationInput - } - - type IssueHydrationInput { - id: ID! - site: ID! - } - Issue: | - type Query { - issues(issuesInput: [IssueInput!]): [Issue] - } - - type Issue { - issueId: ID - description: String - } - - input IssueInput { - id: ID! - site: ID! - } -# language=GraphQL -query: | - query { - activities { - id - issue { - issueId - description - } - } - } -variables: { } -serviceCalls: - - serviceName: "Activity" - request: - # language=GraphQL - query: | - { - activities { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__context: context { - issueHydrationInput { - id - } - } - batch_hydration__issue__context: context { - issueHydrationInput { - site - } - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activities": [ - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-0", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-0" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-1", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-1" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-2", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-2" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-3", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-3" - } - ] - }, - "extensions": {} - } - - serviceName: "Issue" - request: - # language=GraphQL - query: | - query ($v0: [IssueInput!]) { - issues(issuesInput: $v0) { - description - issueId - } - } - variables: {"v0":[{"id":"ISSUE-0","site":"CLOUD-0"},{"id":"ISSUE-1","site":"CLOUD-0"},{"id":"ISSUE-2","site":"CLOUD-0"},{"id":"ISSUE-3","site":"CLOUD-0"}]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "issueId": "ISSUE-0", - "description": "fix A" - }, - { - "issueId": "ISSUE-1", - "description": "fix B" - }, - { - "issueId": "ISSUE-2", - "description": "fix C" - }, - { - "issueId": "ISSUE-3", - "description": "fix D" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activities": [ - { - "id": "ACTIVITY-0", - "issue": { - "issueId": "ISSUE-0", - "description": "fix A" - } - }, - { - "id": "ACTIVITY-1", - "issue": { - "issueId": "ISSUE-1", - "description": "fix B" - } - }, - { - "id": "ACTIVITY-2", - "issue": { - "issueId": "ISSUE-2", - "description": "fix C" - } - }, - { - "id": "ACTIVITY-3", - "issue": { - "issueId": "ISSUE-3", - "description": "fix D" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml deleted file mode 100644 index 1e99a575c..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-list-source-id.yml +++ /dev/null @@ -1,275 +0,0 @@ -name: "complex identified by with list source id" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - users(id: [UserInput]): [User] - } - - input UserInput { - userId: ID - site: String - } - - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] @hydrated( - service: "UserService" - field: "users" - arguments: [{name: "id" value: "$source.authorIds"}] - inputIdentifiedBy: [ - {sourceId: "authorIds.userId" resultId: "id"} - {sourceId: "authorIds.site" resultId: "siteId"} - ] - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - users(id: [UserInput]): [User] - } - - input UserInput { - userId: ID - site: String - } - - type User { - id: ID - name: String - siteId: ID - } - Issues: | - type Query { - issues: [Issue] - } - - type UserRef { - userId: ID - site: String - } - - type Issue { - authorIds: [UserRef] - id: ID - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds { - userId - } - batch_hydration__authors__authorIds: authorIds { - site - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - { - "userId": "USER-1", - "site": "hello" - }, - { - "userId": "USER-2", - "site": "hello" - } - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - { - "userId": "USER-3", - "site": "hello" - } - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - { - "userId": "USER-2", - "site": "jdog" - }, - { - "userId": "USER-4", - "site": "hello" - }, - { - "userId": "USER-5", - "site": "hello" - } - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInput]) { - users(id: $v0) { - id - batch_hydration__authors__id: id - name - batch_hydration__authors__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-1","site":"hello"},{"userId":"USER-2","site":"hello"},{"userId":"USER-3","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-1", - "name": "H-One", - "batch_hydration__authors__id": "USER-1", - "batch_hydration__authors__siteId": "hello" - }, - { - "id": "USER-2", - "name": "H-Two", - "batch_hydration__authors__id": "USER-2", - "batch_hydration__authors__siteId": "hello" - }, - { - "id": "USER-3", - "name": "H-Three", - "batch_hydration__authors__id": "USER-3", - "batch_hydration__authors__siteId": "hello" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInput]) { - users(id: $v0) { - id - batch_hydration__authors__id: id - name - batch_hydration__authors__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-2","site":"jdog"},{"userId":"USER-4","site":"hello"},{"userId":"USER-5","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-2", - "name": "J-Two", - "batch_hydration__authors__id": "USER-2", - "batch_hydration__authors__siteId": "jdog" - }, - { - "id": "USER-4", - "name": "H-Four", - "batch_hydration__authors__id": "USER-4", - "batch_hydration__authors__siteId": "hello" - }, - { - "id": "USER-5", - "name": "H-Five", - "batch_hydration__authors__id": "USER-5", - "batch_hydration__authors__siteId": "hello" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1", - "name": "H-One" - }, - { - "id": "USER-2", - "name": "H-Two" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3", - "name": "H-Three" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2", - "name": "J-Two" - }, - { - "id": "USER-4", - "name": "H-Four" - }, - { - "id": "USER-5", - "name": "H-Five" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml deleted file mode 100644 index 7ef75619c..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-rename.yml +++ /dev/null @@ -1,301 +0,0 @@ -name: "complex identified by with rename" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - users(id: [UserInput]): [User] - } - input UserInput @renamed(from: "UserInputUnderlying") { - userId: ID - site: String - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - author: User @hydrated( - service: "UserService" - field: "users" - arguments: [{name: "id" value: "$source.authorId"}] - inputIdentifiedBy: [ - {sourceId: "authorId.userId" resultId: "id"} - {sourceId: "authorId.site" resultId: "siteId"} - ] - batchSize: 4 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - users(id: [UserInputUnderlying]): [User] - } - - input UserInputUnderlying { - userId: ID - site: String - } - - type User { - id: ID - siteId: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - - type UserRef { - userId: ID - site: String - } - - type Issue { - authorId: UserRef - id: ID - } -# language=GraphQL -query: | - query { - issues { - id - author { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__author: __typename - batch_hydration__author__authorId: authorId { - userId - } - batch_hydration__author__authorId: authorId { - site - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-1", - "site": "hello" - }, - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-3", - "site": "hello" - }, - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-2", - "site": "jdog" - }, - "id": "ISSUE-3" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-4", - "site": "hello" - }, - "id": "ISSUE-4" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-5", - "site": "hello" - }, - "id": "ISSUE-5" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-2", - "site": "jdog" - }, - "id": "ISSUE-6" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-2", - "site": "hello" - }, - "id": "ISSUE-7" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInputUnderlying]) { - users(id: $v0) { - id - batch_hydration__author__id: id - name - batch_hydration__author__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-5","site":"hello"},{"userId":"USER-2","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-5", - "name": "H-Five", - "batch_hydration__author__id": "USER-5", - "batch_hydration__author__siteId": "hello" - }, - { - "id": "USER-2", - "name": "H-Two", - "batch_hydration__author__id": "USER-2", - "batch_hydration__author__siteId": "hello" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInputUnderlying]) { - users(id: $v0) { - id - batch_hydration__author__id: id - name - batch_hydration__author__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-1","site":"hello"},{"userId":"USER-3","site":"hello"},{"userId":"USER-2","site":"jdog"},{"userId":"USER-4","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-1", - "name": "H-One", - "batch_hydration__author__id": "USER-1", - "batch_hydration__author__siteId": "hello" - }, - { - "id": "USER-3", - "name": "H-Three", - "batch_hydration__author__id": "USER-3", - "batch_hydration__author__siteId": "hello" - }, - { - "id": "USER-2", - "name": "J-Two", - "batch_hydration__author__id": "USER-2", - "batch_hydration__author__siteId": "jdog" - }, - { - "id": "USER-4", - "name": "H-Four", - "batch_hydration__author__id": "USER-4", - "batch_hydration__author__siteId": "hello" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "author": { - "id": "USER-1", - "name": "H-One" - } - }, - { - "id": "ISSUE-2", - "author": { - "id": "USER-3", - "name": "H-Three" - } - }, - { - "id": "ISSUE-3", - "author": { - "id": "USER-2", - "name": "J-Two" - } - }, - { - "id": "ISSUE-4", - "author": { - "id": "USER-4", - "name": "H-Four" - } - }, - { - "id": "ISSUE-5", - "author": { - "id": "USER-5", - "name": "H-Five" - } - }, - { - "id": "ISSUE-6", - "author": { - "id": "USER-2", - "name": "J-Two" - } - }, - { - "id": "ISSUE-7", - "author": { - "id": "USER-2", - "name": "H-Two" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml deleted file mode 100644 index a847bc7ef..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by-with-some-null-source-ids.yml +++ /dev/null @@ -1,247 +0,0 @@ -name: "complex identified by with some null source ids" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - users(id: [UserInput]): [User] - } - input UserInput { - userId: ID - site: String - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] @hydrated( - service: "UserService" - field: "users" - arguments: [{name: "id" value: "$source.authorIds"}] - inputIdentifiedBy: [ - {sourceId: "authorIds.userId" resultId: "id"} - {sourceId: "authorIds.site" resultId: "siteId"} - ] - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - users(id: [UserInput]): [User] - } - - input UserInput { - userId: ID - site: String - } - - type User { - id: ID - name: String - siteId: ID - } - Issues: | - type Query { - issues: [Issue] - } - - type UserRef { - userId: ID - site: String - } - - type Issue { - authorIds: [UserRef] - id: ID - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds { - userId - } - batch_hydration__authors__authorIds: authorIds { - site - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - null, - { - "userId": "USER-2", - "site": "hello" - } - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - { - "userId": "USER-3", - "site": "hello" - } - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - { - "userId": "USER-2", - "site": "jdog" - }, - null, - { - "userId": "USER-5", - "site": "hello" - } - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInput]) { - users(id: $v0) { - id - batch_hydration__authors__id: id - name - batch_hydration__authors__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-2","site":"hello"},{"userId":"USER-3","site":"hello"},{"userId":"USER-2","site":"jdog"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-2", - "name": "H-Two", - "batch_hydration__authors__id": "USER-2", - "batch_hydration__authors__siteId": "hello" - }, - { - "id": "USER-3", - "name": "H-Three", - "batch_hydration__authors__id": "USER-3", - "batch_hydration__authors__siteId": "hello" - }, - { - "id": "USER-2", - "name": "J-Two", - "batch_hydration__authors__id": "USER-2", - "batch_hydration__authors__siteId": "jdog" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInput]) { - users(id: $v0) { - id - batch_hydration__authors__id: id - name - batch_hydration__authors__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-5","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-5", - "name": "H-Five", - "batch_hydration__authors__id": "USER-5", - "batch_hydration__authors__siteId": "hello" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-2", - "name": "H-Two" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "USER-3", - "name": "H-Three" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "USER-2", - "name": "J-Two" - }, - { - "id": "USER-5", - "name": "H-Five" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml deleted file mode 100644 index 02f2cd18e..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-identified-by.yml +++ /dev/null @@ -1,297 +0,0 @@ -name: "complex identified by" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - users(id: [UserInput]): [User] - } - input UserInput { - userId: ID - site: String - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - author: User @hydrated( - service: "UserService" - field: "users" - arguments: [{name: "id" value: "$source.authorId"}] - inputIdentifiedBy: [ - {sourceId: "authorId.userId" resultId: "id"} - {sourceId: "authorId.site" resultId: "siteId"} - ] - batchSize: 4 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - users(id: [UserInput]): [User] - } - - input UserInput { - userId: ID - site: String - } - - type User { - id: ID - siteId: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - - type UserRef { - userId: ID - site: String - } - - type Issue { - authorId: UserRef - id: ID - } -# language=GraphQL -query: | - query { - issues { - id - author { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__author: __typename - batch_hydration__author__authorId: authorId { - userId - } - batch_hydration__author__authorId: authorId { - site - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-1", - "site": "hello" - }, - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-3", - "site": "hello" - }, - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-2", - "site": "jdog" - }, - "id": "ISSUE-3" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-4", - "site": "hello" - }, - "id": "ISSUE-4" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-5", - "site": "hello" - }, - "id": "ISSUE-5" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-2", - "site": "jdog" - }, - "id": "ISSUE-6" - }, - { - "__typename__batch_hydration__author": "Issue", - "batch_hydration__author__authorId": { - "userId": "USER-2", - "site": "hello" - }, - "id": "ISSUE-7" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInput]) { - users(id: $v0) { - id - batch_hydration__author__id: id - name - batch_hydration__author__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-5","site":"hello"},{"userId":"USER-2","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-5", - "name": "H-Five", - "batch_hydration__author__id": "USER-5", - "batch_hydration__author__siteId": "hello" - }, - { - "id": "USER-2", - "name": "H-Two", - "batch_hydration__author__id": "USER-2", - "batch_hydration__author__siteId": "hello" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [UserInput]) { - users(id: $v0) { - id - batch_hydration__author__id: id - name - batch_hydration__author__siteId: siteId - } - } - variables: {"v0":[{"userId":"USER-1","site":"hello"},{"userId":"USER-3","site":"hello"},{"userId":"USER-2","site":"jdog"},{"userId":"USER-4","site":"hello"}]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "id": "USER-1", - "name": "H-One", - "batch_hydration__author__id": "USER-1", - "batch_hydration__author__siteId": "hello" - }, - { - "id": "USER-3", - "name": "H-Three", - "batch_hydration__author__id": "USER-3", - "batch_hydration__author__siteId": "hello" - }, - { - "id": "USER-2", - "name": "J-Two", - "batch_hydration__author__id": "USER-2", - "batch_hydration__author__siteId": "jdog" - }, - { - "id": "USER-4", - "name": "H-Four", - "batch_hydration__author__id": "USER-4", - "batch_hydration__author__siteId": "hello" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "author": { - "id": "USER-1", - "name": "H-One" - } - }, - { - "id": "ISSUE-2", - "author": { - "id": "USER-3", - "name": "H-Three" - } - }, - { - "id": "ISSUE-3", - "author": { - "id": "USER-2", - "name": "J-Two" - } - }, - { - "id": "ISSUE-4", - "author": { - "id": "USER-4", - "name": "H-Four" - } - }, - { - "id": "ISSUE-5", - "author": { - "id": "USER-5", - "name": "H-Five" - } - }, - { - "id": "ISSUE-6", - "author": { - "id": "USER-2", - "name": "J-Two" - } - }, - { - "id": "ISSUE-7", - "author": { - "id": "USER-2", - "name": "H-Two" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml b/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml deleted file mode 100644 index a8ce1ddbb..000000000 --- a/test/src/test/resources/fixtures/new hydration/complex identified by/complex-input-object-with-indexed-hydration.yml +++ /dev/null @@ -1,222 +0,0 @@ -name: "complex input object with indexed hydration" -enabled: true -# language=GraphQL -overallSchema: - Activity: | - type Query { - activities: [Activity] - } - - type Activity { - id: ID - issue: Issue @hydrated( - service: "Issue" - field: "issues" - arguments: [{name: "issuesInput" value: "$source.context.issueHydrationInput"}] - indexed: true - ) - } - Issue: | - type Query { - issues(issuesInput: [IssueInput!]): [Issue] - } - - type Issue { - issueId: ID - description: String - } - - input IssueInput { - id: ID! - site: ID! - } -# language=GraphQL -underlyingSchema: - Activity: | - type Query { - activities: [Activity] - } - - type Activity { - id: ID - context: HydrationContext - } - - type HydrationContext { - issueHydrationInput: IssueHydrationInput - } - - type IssueHydrationInput { - id: ID! - site: ID! - } - Issue: | - type Query { - issues(issuesInput: [IssueInput!]): [Issue] - } - - type Issue { - issueId: ID - description: String - } - - input IssueInput { - id: ID! - site: ID! - } -# language=GraphQL -query: | - query { - activities { - id - issue { - issueId - description - } - } - } -variables: { } -serviceCalls: - - serviceName: "Activity" - request: - # language=GraphQL - query: | - { - activities { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__context: context { - issueHydrationInput { - id - } - } - batch_hydration__issue__context: context { - issueHydrationInput { - site - } - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "activities": [ - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-0", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-0" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-1", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-1" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-2", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-2" - }, - { - "__typename__batch_hydration__issue": "Activity", - "batch_hydration__issue__context": { - "issueHydrationInput": { - "id": "ISSUE-3", - "site": "CLOUD-0" - } - }, - "id": "ACTIVITY-3" - } - ] - }, - "extensions": {} - } - - serviceName: "Issue" - request: - # language=GraphQL - query: | - query ($v0: [IssueInput!]) { - issues(issuesInput: $v0) { - description - issueId - } - } - variables: {"v0":[{"id":"ISSUE-0","site":"CLOUD-0"},{"id":"ISSUE-1","site":"CLOUD-0"},{"id":"ISSUE-2","site":"CLOUD-0"},{"id":"ISSUE-3","site":"CLOUD-0"}]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "issueId": "ISSUE-0", - "description": "fix A" - }, - { - "issueId": "ISSUE-1", - "description": "fix B" - }, - { - "issueId": "ISSUE-2", - "description": "fix C" - }, - { - "issueId": "ISSUE-3", - "description": "fix D" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "activities": [ - { - "id": "ACTIVITY-0", - "issue": { - "issueId": "ISSUE-0", - "description": "fix A" - } - }, - { - "id": "ACTIVITY-1", - "issue": { - "issueId": "ISSUE-1", - "description": "fix B" - } - }, - { - "id": "ACTIVITY-2", - "issue": { - "issueId": "ISSUE-2", - "description": "fix C" - } - }, - { - "id": "ACTIVITY-3", - "issue": { - "issueId": "ISSUE-3", - "description": "fix D" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml b/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml deleted file mode 100644 index 325e1321b..000000000 --- a/test/src/test/resources/fixtures/new hydration/conditional-hydration-equals-predicate-works-with-integer-type.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: "conditional hydration equals predicate works with integer type" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: Int - } - - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: Int - bar: Bars - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_A" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: 1 } - } - } - ) - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_B" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: 2 } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: Int - } - union Bars = Bar - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: Int - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__type: type - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__type": 2 - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_B"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar B" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar B" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml b/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml deleted file mode 100644 index c429a657e..000000000 --- a/test/src/test/resources/fixtures/new hydration/conditional-hydration-matches-predicate-works-with-id-type.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: "conditional hydration matches predicate works with id type" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: ID - } - - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: ID - bar: Bars - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_A" - } - ] - when: { - result: { - sourceField: "type" - predicate: { matches: "nope" } - } - } - ) - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_B" - } - ] - when: { - result: { - sourceField: "type" - predicate: { matches: "[a-z]+_B"} - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: ID - } - union Bars = Bar - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: ID - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__type: type - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "type_B" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_B"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar B" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar B" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml b/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml deleted file mode 100644 index 5032ea263..000000000 --- a/test/src/test/resources/fixtures/new hydration/conditional-hydration-starts-with-predicate-works-with-id-type.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: "conditional hydration startsWith predicate works with id type" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: ID - } - - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: ID - bar: Bars - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_A" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "nope" } - } - } - ) - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_B" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "type" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: ID - } - union Bars = Bar - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: ID - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__type: type - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "type_B" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_B"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar B" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar B" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml b/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml deleted file mode 100644 index 76f0a5001..000000000 --- a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-hydration.yml +++ /dev/null @@ -1,200 +0,0 @@ -name: "expecting one child error on extensive field argument passed to hydration" -enabled: true -# language=GraphQL -overallSchema: - TestBoard: | - type Query { - board(id: ID): SoftwareBoard - } - type SoftwareBoard @renamed(from: "Board") { - id: ID - cardChildren: [SoftwareCard] @renamed(from: "issueChildren") - } - type SoftwareCard @renamed(from: "Card") { - id: ID - assignee: User - @hydrated( - service: "Users" - field: "users" - arguments: [{name: "accountIds" value: "$source.issue.assignee.accountId"}] - identifiedBy: "accountId" - batchSize: 3 - ) - } - Users: | - type Query { - users(accountIds: [ID]): [User] - } - type User { - accountId: ID - } -# language=GraphQL -underlyingSchema: - TestBoard: | - type Board { - id: ID - issueChildren: [Card] - } - - type Card { - id: ID - issue: Issue - } - - type Issue { - assignee: TestUser - id: ID - } - - type Query { - board(id: ID): Board - } - - type TestUser { - accountId: String - } - Users: | - type Query { - users(accountIds: [ID]): [User] - } - - type User { - accountId: ID - } -# language=GraphQL -query: | - query { - board(id: 1) { - id - cardChildren { - id - assignee { - accountId - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "TestBoard" - request: - # language=GraphQL - query: | - query ($v0: ID) { - board(id: $v0) { - __typename__rename__cardChildren: __typename - id - rename__cardChildren__issueChildren: issueChildren { - __typename__batch_hydration__assignee: __typename - id - batch_hydration__assignee__issue: issue { - assignee { - accountId - } - } - } - } - } - variables: {"v0":1} - # language=JSON - response: |- - { - "data": { - "board": { - "__typename__rename__cardChildren": "Board", - "id": "1", - "rename__cardChildren__issueChildren": [ - { - "__typename__batch_hydration__assignee": "Card", - "id": "a1", - "batch_hydration__assignee__issue": { - "assignee": { - "accountId": "1" - } - } - }, - { - "__typename__batch_hydration__assignee": "Card", - "id": "a2", - "batch_hydration__assignee__issue": { - "assignee": { - "accountId": "2" - } - } - }, - { - "__typename__batch_hydration__assignee": "Card", - "id": "a3", - "batch_hydration__assignee__issue": { - "assignee": { - "accountId": "3" - } - } - } - ] - } - }, - "extensions": {} - } - - serviceName: "Users" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users(accountIds: $v0) { - accountId - batch_hydration__assignee__accountId: accountId - } - } - variables: {"v0":["1","2","3"]} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "batch_hydration__assignee__accountId": "1", - "accountId": "1" - }, - { - "batch_hydration__assignee__accountId": "2", - "accountId": "2" - }, - { - "batch_hydration__assignee__accountId": "3", - "accountId": "3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "board": { - "id": "1", - "cardChildren": [ - { - "id": "a1", - "assignee": { - "accountId": "1" - } - }, - { - "id": "a2", - "assignee": { - "accountId": "2" - } - }, - { - "id": "a3", - "assignee": { - "accountId": "3" - } - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml deleted file mode 100644 index eb0084be6..000000000 --- a/test/src/test/resources/fixtures/new hydration/expecting-one-child-error-on-extensive-field-argument-passed-to-synthetic-hydration.yml +++ /dev/null @@ -1,203 +0,0 @@ -name: "expecting one child error on extensive field argument passed to synthetic hydration" -enabled: true -# language=GraphQL -overallSchema: - TestBoard: | - type Query { - board(id: ID): SoftwareBoard - } - type SoftwareBoard @renamed(from: "Board") { - id: ID - cardChildren: [SoftwareCard] @renamed(from: "issueChildren") - } - type SoftwareCard @renamed(from: "Card") { - id: ID - assignee: User - @hydrated( - service: "Users" - field: "usersQuery.users" - arguments: [{name: "accountIds" value: "$source.issue.assignee.accountId"}] - identifiedBy: "accountId" - batchSize: 3 - ) - } - Users: | - type Query { - usersQuery: UserQuery - } - type UserQuery { - users(accountIds: [ID]): [User] - } - type User { - accountId: ID - } -# language=GraphQL -underlyingSchema: - TestBoard: | - type Board { - id: ID - issueChildren: [Card] - } - - type Card { - id: ID - issue: Issue - } - - type Issue { - assignee: TestUser - id: ID - } - - type Query { - board(id: ID): Board - } - - type TestUser { - accountId: String - } - Users: | - type Query { - usersQuery: UserQuery - } - - type User { - accountId: ID - } - - type UserQuery { - users(accountIds: [ID]): [User] - } -# language=GraphQL -query: | - query { - board(id: 1) { - id - cardChildren { - assignee { - accountId - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "TestBoard" - request: - # language=GraphQL - query: | - query ($v0: ID) { - board(id: $v0) { - __typename__rename__cardChildren: __typename - id - rename__cardChildren__issueChildren: issueChildren { - __typename__batch_hydration__assignee: __typename - batch_hydration__assignee__issue: issue { - assignee { - accountId - } - } - } - } - } - variables: {"v0":1} - # language=JSON - response: |- - { - "data": { - "board": { - "__typename__rename__cardChildren": "Board", - "id": "1", - "rename__cardChildren__issueChildren": [ - { - "__typename__batch_hydration__assignee": "Card", - "batch_hydration__assignee__issue": { - "assignee": { - "accountId": "1" - } - } - }, - { - "__typename__batch_hydration__assignee": "Card", - "batch_hydration__assignee__issue": { - "assignee": { - "accountId": "2" - } - } - }, - { - "__typename__batch_hydration__assignee": "Card", - "batch_hydration__assignee__issue": { - "assignee": { - "accountId": "3" - } - } - } - ] - } - }, - "extensions": {} - } - - serviceName: "Users" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersQuery { - users(accountIds: $v0) { - accountId - batch_hydration__assignee__accountId: accountId - } - } - } - variables: {"v0":["1","2","3"]} - # language=JSON - response: |- - { - "data": { - "usersQuery": { - "users": [ - { - "batch_hydration__assignee__accountId": "1", - "accountId": "1" - }, - { - "batch_hydration__assignee__accountId": "2", - "accountId": "2" - }, - { - "batch_hydration__assignee__accountId": "3", - "accountId": "3" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "board": { - "id": "1", - "cardChildren": [ - { - "assignee": { - "accountId": "1" - } - }, - { - "assignee": { - "accountId": "2" - } - }, - { - "assignee": { - "accountId": "3" - } - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml b/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml deleted file mode 100644 index ccb11ad8a..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-batching-returns-null.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: "hydration batching returns null" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - null, - null, - null - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml deleted file mode 100644 index 0c2372b99..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-forwards-error.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: "hydration call forwards error" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId1", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId1"} - # language=JSON - response: |- - { - "errors": [ - { - "message": "Some error occurred" - }, - { - "message": "Some error with extension occurred", - "path": [ - "barById", - "name"], - "extensions": { - "classification": "SomeCustomError" - } - } - ], - "extensions": {} - } -# language=JSON -response: |- - { - "errors": [ - { - "message": "Some error occurred", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - }, - { - "message": "Some error with extension occurred", - "path": [ - "barById", - "name" - ], - "locations": [], - "extensions": { - "classification": "SomeCustomError" - } - } - ], - "data": { - "foo": { - "bar": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml deleted file mode 100644 index 8574ecbcf..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-over-itself-with-renamed-types.yml +++ /dev/null @@ -1,195 +0,0 @@ -name: "hydration call over itself with renamed types" -enabled: true -# language=GraphQL -overallSchema: - testing: | - type Query { - testing: Testing - characters(ids: [ID!]!): [TestingCharacter] - } - type Testing { - movies: [TestingMovie] - } - type TestingCharacter @renamed(from: "Character") { - id: ID! - name: String - } - type TestingMovie @renamed(from: "Movie") { - id: ID! - name: String - characters: [TestingCharacter] - @hydrated( - service: "testing" - field: "characters" - arguments: [{name: "ids" value: "$source.characterIds"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - testing: | - type Character { - id: ID! - name: String - } - - type Movie { - characterIds: [ID] - id: ID! - name: String - } - - type Query { - characters(ids: [ID!]!): [Character] - testing: Testing - } - - type Testing { - movies: [Movie] - } -# language=GraphQL -query: | - query { - testing { - movies { - id - name - characters { - id - name - } - ...F1 - } - } - } - - fragment F1 on TestingMovie { - name - } -variables: { } -serviceCalls: - - serviceName: "testing" - request: - # language=GraphQL - query: | - { - testing { - movies { - __typename__batch_hydration__characters: __typename - batch_hydration__characters__characterIds: characterIds - id - name - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "testing": { - "movies": [ - { - "name": "Movie 1", - "id": "M1", - "batch_hydration__characters__characterIds": [ - "C1", - "C2" - ], - "__typename__batch_hydration__characters": "Movie" - }, - { - "name": "Movie 2", - "id": "M2", - "batch_hydration__characters__characterIds": [ - "C1", - "C2", - "C3" - ], - "__typename__batch_hydration__characters": "Movie" - } - ] - } - }, - "extensions": {} - } - - serviceName: "testing" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - characters(ids: $v0) { - id - batch_hydration__characters__id: id - name - } - } - variables: {"v0":["C1","C2","C3"]} - # language=JSON - response: |- - { - "data": { - "characters": [ - { - "name": "Luke", - "batch_hydration__characters__id": "C1", - "id": "C1" - }, - { - "name": "Leia", - "batch_hydration__characters__id": "C2", - "id": "C2" - }, - { - "name": "Anakin", - "batch_hydration__characters__id": "C3", - "id": "C3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "testing": { - "movies": [ - { - "id": "M1", - "name": "Movie 1", - "characters": [ - { - "id": "C1", - "name": "Luke" - }, - { - "id": "C2", - "name": "Leia" - } - ] - }, - { - "id": "M2", - "name": "Movie 2", - "characters": [ - { - "id": "C1", - "name": "Luke" - }, - { - "id": "C2", - "name": "Leia" - }, - { - "id": "C3", - "name": "Anakin" - } - ] - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml deleted file mode 100644 index 4341efaf9..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-argument-value-from-original-field-argument.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: "hydration call with argument value from original field argument" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(extraArg: String, id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - author(extraArg: String): User @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "extraArg" value: "$argument.extraArg"} - {name: "id" value: "$source.authorId"} - ] - identifiedBy: "id" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(extraArg: String, id: [ID]): [User] - } - - type User { - id: ID - name: String - } - Issues: | - type Issue { - authorId: ID - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - author(extraArg: "extraArg") { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__author: __typename - batch_hydration__author__authorId: authorId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__author": "Issue", - "id": "ISSUE-1", - "batch_hydration__author__authorId": "USER-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: [ID]) { - usersByIds(extraArg: $v0, id: $v1) { - batch_hydration__author__id: id - name - } - } - variables: {"v0":"extraArg","v1":["USER-1"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "User 1", - "batch_hydration__author__id": "USER-1" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "author": { - "name": "User 1" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml deleted file mode 100644 index 42f951f70..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part-and-synthetic-field.yml +++ /dev/null @@ -1,223 +0,0 @@ -name: "hydration call with fragments in the hydrated part and synthetic field" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - userQuery: UserQuery - } - type UserQuery { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authorDetails: [AuthorDetail] - authors: [User] - @hydrated( - service: "UserService" - field: "userQuery.usersByIds" - arguments: [{name: "id" value: "$source.authorDetails.authorId"}] - identifiedBy: "id" - ) - } - type AuthorDetail { - name: String - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - userQuery: UserQuery - } - - type User { - id: ID - name: String - } - - type UserQuery { - usersByIds(id: [ID]): [User] - } - Issues: | - type AuthorDetail { - authorId: ID - name: String - } - - type Issue { - authorDetails: [AuthorDetail] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - fragment IssueFragment on Issue { - id - } - - query { - issues { - ...IssueFragment - id - authors { - id - ...UserFragment1 - } - } - userQuery { - usersByIds(id: ["USER-1"]) { - ...UserFragment1 - } - } - } - - fragment UserFragment1 on User { - id - name - ...UserFragment2 - } - - fragment UserFragment2 on User { - name - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - userQuery { - usersByIds(id: $v0) { - id - name - } - } - } - variables: {"v0":["USER-1"]} - # language=JSON - response: |- - { - "data": { - "userQuery": { - "usersByIds": [ - { - "name": "User 1", - "id": "USER-1" - } - ] - } - }, - "extensions": {} - } - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorDetails: authorDetails { - authorId - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__authors__authorDetails": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - userQuery { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - name - } - } - } - variables: {"v0":["USER-1","USER-2"]} - # language=JSON - response: |- - { - "data": { - "userQuery": { - "usersByIds": [ - { - "name": "User 1", - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "name": "User 2", - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1", - "name": "User 1" - }, - { - "id": "USER-2", - "name": "User 2" - } - ] - } - ], - "userQuery": { - "usersByIds": [ - { - "id": "USER-1", - "name": "User 1" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml deleted file mode 100644 index abe3f6e02..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-fragments-in-the-hydrated-part.yml +++ /dev/null @@ -1,205 +0,0 @@ -name: "hydration call with fragments in the hydrated part" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authorDetails: [AuthorDetail] - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authorDetails.authorId"}] - identifiedBy: "id" - batchSize: 2 - ) - } - type AuthorDetail { - name: String - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - name: String - } - Issues: | - type AuthorDetail { - authorId: ID - name: String - } - - type Issue { - authorDetails: [AuthorDetail] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - fragment IssueFragment on Issue { - id - } - - query { - issues { - ...IssueFragment - id - authors { - id - ...UserFragment1 - } - } - usersByIds(id: ["USER-1"]) { - ...UserFragment1 - } - } - - fragment UserFragment1 on User { - id - name - ...UserFragment2 - } - - fragment UserFragment2 on User { - name - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - name - } - } - variables: {"v0":["USER-1"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "User 1", - "id": "USER-1" - } - ] - }, - "extensions": {} - } - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorDetails: authorDetails { - authorId - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__authors__authorDetails": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - name - } - } - variables: {"v0":["USER-1","USER-2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "User 1", - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "name": "User 2", - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "USER-1", - "name": "User 1" - }, - { - "id": "USER-2", - "name": "User 2" - } - ] - } - ], - "usersByIds": [ - { - "id": "USER-1", - "name": "User 1" - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml b/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml deleted file mode 100644 index a0b4c29d6..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-call-with-two-argument-values-from-original-field-arguments.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: "hydration call with two argument values from original field arguments" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(extraArg1: String, extraArg2: Int, id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - author(extraArg1: String, extraArg2: Int): User @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [ - {name: "extraArg1" value: "$argument.extraArg1"} - {name: "extraArg2" value: "$argument.extraArg2"} - {name: "id" value: "$source.authorId"} - ] - identifiedBy: "id" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(extraArg1: String, extraArg2: Int, id: [ID]): [User] - } - - type User { - id: ID - name: String - } - Issues: | - type Issue { - authorId: ID - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - author(extraArg1: "extraArg1", extraArg2: 10) { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__author: __typename - batch_hydration__author__authorId: authorId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__author": "Issue", - "id": "ISSUE-1", - "batch_hydration__author__authorId": "USER-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: Int, $v2: [ID]) { - usersByIds(extraArg1: $v0, extraArg2: $v1, id: $v2) { - batch_hydration__author__id: id - name - } - } - variables: {"v0":"extraArg1","v1":10,"v2":["USER-1"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "User 1", - "batch_hydration__author__id": "USER-1" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "author": { - "name": "User 1" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml b/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml deleted file mode 100644 index bd6acb0d8..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface-with-type-rename.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: "hydration from field in interface with type rename" -enabled: true -# language=GraphQL -overallSchema: - issues: | - type Query { - issue(id: ID): RenamedIssue - } - type RenamedIssue @renamed(from: "Issue") { - id: ID - title: String - issueAuthor: RenamedUser - @hydrated( - service: "users" - field: "user" - arguments: [{name: "id" value: "$source.author.userId"}] - ) - } - users: | - type Query { - user(id: ID!): RenamedUser - } - type RenamedUser @renamed(from: "User") { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - issues: | - type Issue { - id: ID! - title: String - author: User - } - - interface User { - userId: ID! - } - - type ProductUser implements User { - userId: ID! - email: String - } - - type Query { - issue(id: ID): Issue - } - users: | - type User { - id: ID! - name: String - } - - type Query { - user(id: ID!): User - } -# language=GraphQL -query: | - query { - issue(id: "1") { - title - issueAuthor { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(id: $v0) { - __typename__hydration__issueAuthor: __typename - hydration__issueAuthor__author: author { - userId - } - title - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "title": "Issue 1", - "hydration__issueAuthor__author": { - "userId": "1001" - }, - "__typename__hydration__issueAuthor": "Issue" - } - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - user(id: $v0) { - name - } - } - variables: {"v0":"1001"} - # language=JSON - response: |- - { - "data": { - "user": { - "name": "McUser Face" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "title": "Issue 1", - "issueAuthor": { - "name": "McUser Face" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml b/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml deleted file mode 100644 index 3c845b2d5..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-from-field-in-interface.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: "hydration from field in interface" -enabled: true -# language=GraphQL -overallSchema: - issues: | - type Query { - issue(id: ID): Issue - } - type Issue { - id: ID - title: String - issueAuthor: User - @hydrated( - service: "users" - field: "user" - arguments: [{name: "id" value: "$source.author.userId"}] - ) - } - users: | - type Query { - user(id: ID!): User - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - issues: | - type Issue { - id: ID! - title: String - author: User - } - - interface User { - userId: ID! - } - - type ProductUser implements User { - userId: ID! - email: String - } - - type Query { - issue(id: ID): Issue - } - users: | - type User { - id: ID! - name: String - } - - type Query { - user(id: ID!): User - } -# language=GraphQL -query: | - query { - issue(id: "1") { - title - issueAuthor { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(id: $v0) { - __typename__hydration__issueAuthor: __typename - hydration__issueAuthor__author: author { - userId - } - title - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "title": "Issue 1", - "hydration__issueAuthor__author": { - "userId": "1001" - }, - "__typename__hydration__issueAuthor": "Issue" - } - }, - "extensions": {} - } - - serviceName: "users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - user(id: $v0) { - name - } - } - variables: {"v0":"1001"} - # language=JSON - response: |- - { - "data": { - "user": { - "name": "McUser Face" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "title": "Issue 1", - "issueAuthor": { - "name": "McUser Face" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml b/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml deleted file mode 100644 index 9dbf9782d..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-inside-a-renamed-field.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: "hydration inside a renamed field" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - barById(id: ID!): RenamedBar - } - type RenamedBar @renamed(from: "Bar") { - id: ID! - } - Foo: | - type Query { - foo: Foo @renamed(from: "fooOriginal") - } - type Foo { - id: ID! - fooBar: RenamedBar - @hydrated( - service: "Bar" - field: "barById" - arguments: [{name: "id" value: "$source.fooBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - id: ID! - } - - type Query { - barById(id: ID!): Bar - } - Foo: | - type Foo { - fooBarId: ID - id: ID! - } - - type Query { - fooOriginal: Foo - } -# language=GraphQL -query: | - query { - foo { - id - fooBar { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - rename__foo__fooOriginal: fooOriginal { - __typename__hydration__fooBar: __typename - hydration__fooBar__fooBarId: fooBarId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "rename__foo__fooOriginal": { - "hydration__fooBar__fooBarId": "hydrated-bar", - "id": "Foo", - "__typename__hydration__fooBar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - barById(id: $v0) { - id - } - } - variables: {"v0":"hydrated-bar"} - # language=JSON - response: |- - { - "data": { - "barById": { - "id": "hydrated-bar" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "id": "Foo", - "fooBar": { - "id": "hydrated-bar" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml deleted file mode 100644 index 1119ba896..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-input.yml +++ /dev/null @@ -1,172 +0,0 @@ -name: "hydration list input" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barIds"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barIds: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barIds: barIds - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barIds": [ - "barId1", - "barId2", - "barId3" - ], - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - id - name - } - } - variables: {"v0":"barId1"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1", - "id": "barId1" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - id - name - } - } - variables: {"v0":"barId3"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar4", - "id": "barId3" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - id - name - } - } - variables: {"v0":"barId2"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar3", - "id": "barId2" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "id": "barId1", - "name": "Bar1" - }, - { - "id": "barId2", - "name": "Bar3" - }, - { - "id": "barId3", - "name": "Bar4" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml deleted file mode 100644 index b211104d4..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching-forwards-error.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: "hydration list with batching forwards error" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "data": null, - "errors": [ - { - "message": "Some error occurred" - } - ], - "extensions": {} - } -# language=JSON -response: |- - { - "errors": [ - { - "message": "Some error occurred", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ], - "data": { - "foo": { - "bar": [ - null, - null, - null - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml deleted file mode 100644 index 0cf94a2f9..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-with-batching.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: "hydration list with batching" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barsById(id: [ID]): [Bar] - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "Bar1", - "batch_hydration__bar__id": "barId1" - }, - { - "name": "Bar2", - "batch_hydration__bar__id": "barId2" - }, - { - "name": "Bar3", - "batch_hydration__bar__id": "barId3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "name": "Bar1" - }, - { - "name": "Bar2" - }, - { - "name": "Bar3" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml b/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml deleted file mode 100644 index 0d4d9e625..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-list-with-one-element.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: "hydration list with one element" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": [ - "barId1" - ], - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - id - name - } - } - variables: {"v0":"barId1"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1", - "id": "barId1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - { - "id": "barId1", - "name": "Bar1" - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml deleted file mode 100644 index f62cfffcb..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces-asking-typename.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: "hydration with interfaces asking typename" -enabled: true -# language=GraphQL -overallSchema: - Issues: | - type Query { - nodes: [Node] - ariById(id: ID!): ID - } - type JiraIssue implements Node @renamed(from: "Issue") { - id: ID - } - interface Node { - id: ID - } - type User implements Node { - id: ID - @hydrated( - service: "Issues" - field: "ariById" - arguments: [{name: "id" value: "$source.id"}] - ) - } -# language=GraphQL -underlyingSchema: - Issues: | - type Query { - ariById(id: ID!): ID - nodes: [Node] - } - interface Node { - id: ID - } - type Issue implements Node { - id: ID - } - type User implements Node { - id: ID - name: String - } -# language=GraphQL -query: | - query { - nodes { - __typename - id - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - nodes { - __typename - ... on Issue { - id - } - ... on User { - __typename__hydration__id: __typename - hydration__id__id: id - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "nodes": [ - { - "__typename": "Issue", - "id": "GQLGW-001" - }, - { - "__typename": "Issue", - "id": "GQLGW-1102" - }, - { - "__typename": "User", - "__typename__hydration__id": "User", - "hydration__id__id": "ari:i-always-forget-the-format/1" - } - ] - }, - "extensions": {} - } - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - ariById(id: $v0) - } - variables: {"v0":"ari:i-always-forget-the-format/1"} - # language=JSON - response: |- - { - "data": { - "ariById": "Definitely an ARI" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "nodes": [ - { - "__typename": "JiraIssue", - "id": "GQLGW-001" - }, - { - "__typename": "JiraIssue", - "id": "GQLGW-1102" - }, - { - "__typename": "User", - "id": "Definitely an ARI" - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml deleted file mode 100644 index baea03fbe..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-interfaces.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: "hydration with interfaces" -enabled: true -# language=GraphQL -overallSchema: - Issues: | - type Query { - nodes: [Node] - idByAri(id: ID!): ID - } - type JiraIssue implements Node @renamed(from: "Issue") { - id: ID - } - interface Node { - id: ID - } - type User implements Node { - id: ID - @hydrated( - service: "Issues" - field: "idByAri" - arguments: [{name: "id" value: "$source.ari"}] - ) - } -# language=GraphQL -underlyingSchema: - Issues: | - type Query { - nodes: [Node] - idByAri(id: ID!): ID - } - interface Node { - id: ID - } - type Issue implements Node { - id: ID - } - type User implements Node { - id: ID - ari: ID! - name: String! - } -# language=GraphQL -query: | - query { - nodes { - id - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - nodes { - ... on Issue { - id - } - ... on User { - __typename__hydration__id: __typename - hydration__id__ari: ari - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "nodes": [ - { - "id": "GQLGW-001" - }, - { - "id": "GQLGW-1102" - }, - { - "__typename__hydration__id": "User", - "hydration__id__ari": "ari:i-always-forget-the-format/1" - } - ] - }, - "extensions": {} - } - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - idByAri(id: $v0) - } - variables: {"v0":"ari:i-always-forget-the-format/1"} - # language=JSON - response: |- - { - "data": { - "idByAri": "Hello World" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "nodes": [ - { - "id": "GQLGW-001" - }, - { - "id": "GQLGW-1102" - }, - { - "id": "Hello World" - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml deleted file mode 100644 index c2e8ab0f0..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-more-interfaces.yml +++ /dev/null @@ -1,165 +0,0 @@ -name: "hydration with more interfaces" -enabled: true -# language=GraphQL -overallSchema: - Issues: | - type Query { - nodes: [Node] - trollName(id: ID!): String - ariById(id: ID!): ID - } - type JiraIssue implements Node @renamed(from: "Issue") { - id: ID - } - type Troll implements Node { - id: ID - @hydrated( - service: "Issues" - field: "trollName" - arguments: [{name: "id" value: "$source.id"}] - ) - } - interface Node { - id: ID - } - type User implements Node { - id: ID - @hydrated( - service: "Issues" - field: "ariById" - arguments: [{name: "id" value: "$source.id"}] - ) - } -# language=GraphQL -underlyingSchema: - Issues: | - type Query { - trollName(id: ID!): String - ariById(id: ID!): ID - nodes: [Node] - } - interface Node { - id: ID - } - type Troll implements Node { - id: ID - nameOfFirstThingEaten: String - } - type Issue implements Node { - id: ID - } - type User implements Node { - id: ID - ari: ID - } -# language=GraphQL -query: | - query { - nodes { - id - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - nodes { - ... on Issue { - id - } - ... on Troll { - __typename__hydration__id: __typename - hydration__id__id: id - } - ... on User { - __typename__hydration__id: __typename - hydration__id__id: id - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "nodes": [ - { - "id": "GQLGW-001" - }, - { - "id": "GQLGW-1102" - }, - { - "__typename__hydration__id": "Troll", - "hydration__id__id": "My Arm" - }, - { - "__typename__hydration__id": "User", - "hydration__id__id": "Franklin" - }, - { - "id": "GQLGW-11" - } - ] - }, - "extensions": {} - } - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - trollName(id: $v0) - } - variables: {"v0":"My Arm"} - # language=JSON - response: |- - { - "data": { - "trollName": "Troll" - }, - "extensions": {} - } - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - ariById(id: $v0) - } - variables: {"v0":"Franklin"} - # language=JSON - response: |- - { - "data": { - "ariById": "ari:user/Franklin" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "nodes": [ - { - "id": "GQLGW-001" - }, - { - "id": "GQLGW-1102" - }, - { - "id": "Troll" - }, - { - "id": "ari:user/Franklin" - }, - { - "id": "GQLGW-11" - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml deleted file mode 100644 index f69b17b78..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-conditions-ignores-false-conditions.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: "hydration with multiple conditions ignores false conditions" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: String - } - - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: Bars - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_A" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "type_A" } - } - } - ) - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_B" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "type_B" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: String - } - union Bars = Bar - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__type: type - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "type_B" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_B"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar B" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar B" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml b/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml deleted file mode 100644 index 4c097f114..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-with-multiple-true-conditions-takes-first.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: "hydration with multiple true conditions takes first" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: String - } - - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: String - bar: Bars - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_A" - } - ] - when: { - result: { - sourceField: "type" - predicate: { startsWith: "type" } - } - } - ) - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_B" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: "type_B" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: String - } - union Bars = Bar - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__type: type - hydration__bar__type: type - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__type": "type_B" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_A"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar A" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar A" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml b/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml deleted file mode 100644 index 54e4573ad..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-within-hydration-with-variables.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: "hydration within hydration with variables" -enabled: true -# language=GraphQL -overallSchema: - boards: | - type Query { - board: Board - } - - type Board { - id: ID - title: String - issue: Issue - @hydrated( - service: "issues" - field: "issue" - arguments: [{name: "id" value: "$source.issueId"}] - ) - } - issues: | - type Query { - issue(id: ID!): Issue - } - - type Issue { - id: ID! - cloudId: ID! - - comments(first: Int = 20): CommentConnection - @hydrated( - service: "comments" - field: "comments" - arguments: [ - {name: "cloudId" value: "$source.cloudId"} - {name: "first" value: "$argument.first"} - ] - ) - } - comments: | - type Query { - comments(cloudId: ID!, first: Int): CommentConnection - } - - type CommentConnection { - totalCount: Int - } -# language=GraphQL -underlyingSchema: - boards: | - type Query { - board: Board - } - - type Board { - id: ID - title: String - issueId: ID! - } - issues: | - type Query { - issue(id: ID!): Issue - } - - type Issue { - id: ID! - cloudId: ID! - } - comments: | - type Query { - comments(cloudId: ID!, first: Int): CommentConnection - } - - type CommentConnection { - totalCount: Int - } -# language=GraphQL -query: | - query($first: Int) { - board { - issue { - comments(first: $first) { - totalCount - } - } - } - } -variables: - first: 10 -serviceCalls: - - serviceName: "boards" - request: - # language=GraphQL - query: | - { - board { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "board": { - "hydration__issue__issueId": "ISSUE-1", - "__typename__hydration__issue": "Board" - } - }, - "extensions": {} - } - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issue(id: $v0) { - __typename__hydration__comments: __typename - hydration__comments__cloudId: cloudId - } - } - variables: {"v0":"ISSUE-1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__comments__cloudId": "CLOUD_ID-1", - "__typename__hydration__comments": "Issue" - } - }, - "extensions": {} - } - - serviceName: "comments" - request: - # language=GraphQL - query: | - query ($v0: ID!, $v1: Int) { - comments(cloudId: $v0, first: $v1) { - totalCount - } - } - variables: {"v0":"CLOUD_ID-1","v1":10} - # language=JSON - response: |- - { - "data": { - "comments": { - "totalCount": 10 - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "board": { - "issue": { - "comments": { - "totalCount": 10 - } - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml b/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml deleted file mode 100644 index 4a3287dcd..000000000 --- a/test/src/test/resources/fixtures/new hydration/hydration-works-when-an-ancestor-field-has-been-renamed.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: "hydration works when an ancestor field has been renamed" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type DevOpsIssue @renamed(from: "Issue") { - id: ID - } - type DevOpsRelationship @renamed(from: "Relationship") { - devOpsIssue: DevOpsIssue - @hydrated( - service: "IssueService" - field: "issue" - arguments: [{name: "id" value: "$source.issueId"}] - ) - } - type DevOpsRelationshipConnection @renamed(from: "RelationshipConnection") { - nodes: [DevOpsRelationship] - } - type Query { - devOpsRelationships: DevOpsRelationshipConnection @renamed(from: "relationships") - devOpsIssue(id: ID): DevOpsIssue @renamed(from: "issue") - issue(id: ID): DevOpsIssue @hidden - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - } - - type Query { - issue(id: ID): Issue - relationships: RelationshipConnection - } - - type Relationship { - issueId: ID - } - - type RelationshipConnection { - nodes: [Relationship] - } -# language=GraphQL -query: | - query { - devOpsRelationships { - nodes { - devOpsIssue { - id - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - { - rename__devOpsRelationships__relationships: relationships { - nodes { - __typename__hydration__devOpsIssue: __typename - hydration__devOpsIssue__issueId: issueId - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "rename__devOpsRelationships__relationships": { - "nodes": [ - { - "__typename__hydration__devOpsIssue": "Relationship", - "hydration__devOpsIssue__issueId": "1" - } - ] - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(id: $v0) { - id - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "id": "1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "devOpsRelationships": { - "nodes": [ - { - "devOpsIssue": { - "id": "1" - } - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml b/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml deleted file mode 100644 index 6947031e1..000000000 --- a/test/src/test/resources/fixtures/new hydration/index-hydration-all-null-ids.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: "index hydration all null ids" -enabled: true -# language=GraphQL -overallSchema: - Issues: | - type Query { - issueById(id: ID!): Issue! - } - type Issue { - id: ID! - key: String - collaborators: [User] - @hydrated( - service: "Users" - field: "usersByIds" - arguments: [ - {name: "ids", value: "$source.collaboratorIds"} - ] - identifiedBy: "id" - indexed: true - ) - } - Users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - Issues: | - type Query { - issueById(id: ID!): Issue! - } - type Issue { - id: ID! - key: String - collaboratorIds: [ID] - } - Users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - query { - issueById(id: "10000") { - key - collaborators { - __typename - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__batch_hydration__collaborators: __typename - batch_hydration__collaborators__collaboratorIds: collaboratorIds - key - } - } - variables: {"v0":"10000"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "key": "GQLGW-1000", - "batch_hydration__collaborators__collaboratorIds": [ - null, - null - ], - "__typename__batch_hydration__collaborators": "Issue" - } - } - } -# language=JSON -response: | - { - "data": { - "issueById": { - "key": "GQLGW-1000", - "collaborators": null - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml b/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml deleted file mode 100644 index 0d9af5868..000000000 --- a/test/src/test/resources/fixtures/new hydration/index-hydration-with-partitioned-inputs.yml +++ /dev/null @@ -1,213 +0,0 @@ -name: "index hydration with partitioned inputs" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 2 - indexed: true - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - } - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "site-1/user-1", - "site-2/user-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "site-1/user-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "site-2/user-4", - "site-1/user-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - } - } - variables: {"v0":["site-1/user-1","site-1/user-3"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "site-1/user-1" - }, - { - "id": "site-1/user-3" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - } - } - variables: {"v0":["site-1/user-5"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "site-1/user-5" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - } - } - variables: {"v0":["site-2/user-2","site-2/user-4"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "site-2/user-2" - }, - { - "id": "site-2/user-4" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "id": "site-1/user-1" - }, - { - "id": "site-2/user-2" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "id": "site-1/user-3" - } - ] - }, - { - "id": "ISSUE-3", - "authors": [ - { - "id": "site-2/user-4" - }, - { - "id": "site-1/user-5" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml deleted file mode 100644 index 2b4afd30a..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-one-batch-returns-errors.yml +++ /dev/null @@ -1,192 +0,0 @@ -name: "hydration matching using index one batch returns errors" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ] - }, - { - "id": "ISSUE-2", - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1", - "2" - ] - }, - { - "id": "ISSUE-3", - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "2", - "4" - ] - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "User-1" - }, - null - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["4"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": null - }, - "errors": [ - { - "message": "Fail" - } - ], - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "User-1" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "name": "User-1" - }, - null - ] - }, - { - "id": "ISSUE-3", - "authors": [ - null, - null - ] - } - ] - }, - "errors": [ - { - "message": "Fail", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml deleted file mode 100644 index 9911aff91..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-result-size-invariant-mismatch.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: "hydration matching using index result size invariant mismatch" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1", - "2" - ], - "id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "Name" - } - ] - }, - "extensions": {} - } -# language=JSON -response: null -exception: - message: "If you use indexed hydration then you MUST follow a contract where the resolved nodes matches the size of the input arguments.*" diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml deleted file mode 100644 index 4c2b2d178..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-errors.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: "hydration matching using index returning errors" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1", - "2" - ], - "id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": null - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - null - ] - }, - { - "id": "ISSUE-2", - "authors": [ - null, - null - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml deleted file mode 100644 index bb3ed951d..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null-elements.yml +++ /dev/null @@ -1,145 +0,0 @@ -name: "hydration matching using index returning null elements" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1", - "2" - ], - "id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - null, - { - "name": "Name 2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - null - ] - }, - { - "id": "ISSUE-2", - "authors": [ - null, - { - "name": "Name 2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml deleted file mode 100644 index 0dfe1ce76..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-returning-null.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: "hydration matching using index returning null" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1", - "2" - ], - "id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": null - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - null] - }, - { - "id": "ISSUE-2", - "authors": [ - null, - null] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml deleted file mode 100644 index bd737e009..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists-with-hydration-field-not-exposed.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: "hydration matching using index with lists with hydration field not exposed" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - echo: String - usersByIssueIds(issueIds: [ID]): [[User]] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIssueIds" - arguments: [{name: "issueIds" value: "$source.id"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - echo: String - usersByIssueIds(issueIds: [ID]): [[User]] - } - - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - id - batch_hydration__authors__id: id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1", - "batch_hydration__authors__id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-2", - "batch_hydration__authors__id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIssueIds(issueIds: $v0) { - name - } - } - variables: {"v0":["ISSUE-1","ISSUE-2"]} - # language=JSON - response: |- - { - "data": { - "usersByIssueIds": [ - [ - { - "name": "Name" - } - ], - [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "Name" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml deleted file mode 100644 index 13e0f115e..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-lists.yml +++ /dev/null @@ -1,149 +0,0 @@ -name: "hydration matching using index with lists" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIssueIds(issueIds: [ID]): [[User]] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIssueIds" - arguments: [{name: "issueIds" value: "$source.id"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIssueIds(issueIds: [ID]): [[User]] - } - - type User { - id: ID - name: String - } - Issues: | - type Issue { - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - id - batch_hydration__authors__id: id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1", - "batch_hydration__authors__id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-2", - "batch_hydration__authors__id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIssueIds(issueIds: $v0) { - name - } - } - variables: {"v0":["ISSUE-1","ISSUE-2"]} - # language=JSON - response: |- - { - "data": { - "usersByIssueIds": [ - [ - { - "name": "Name" - } - ], - [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "Name" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml deleted file mode 100644 index 798d0e75e..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index-with-null-input-nodes.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: "hydration matching using index with null input nodes" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - - type User { - id: ID - name: String - } - # language=GraphQL - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - null, - "2" - ], - "id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "Name" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - null, - { - "name": "Name 2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml b/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml deleted file mode 100644 index 6945f9628..000000000 --- a/test/src/test/resources/fixtures/new hydration/index/hydration-matching-using-index.yml +++ /dev/null @@ -1,148 +0,0 @@ -name: "hydration matching using index" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "ids" value: "$source.authorIds"}] - indexed: true - batchSize: 5 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(ids: [ID]): [User] - } - - type User { - id: ID - name: String - } - Issues: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "1", - "2" - ], - "id": "ISSUE-2" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(ids: $v0) { - name - } - } - variables: {"v0":["1","2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "Name" - } - ] - }, - { - "id": "ISSUE-2", - "authors": [ - { - "name": "Name" - }, - { - "name": "Name 2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml b/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml deleted file mode 100644 index 83a0c28ef..000000000 --- a/test/src/test/resources/fixtures/new hydration/multiple-conditional-hydrations-with-different-source-fields.yml +++ /dev/null @@ -1,165 +0,0 @@ -name: "multiple conditional hydrations with different source fields" -enabled: true -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - type: Int - } - - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - type: Int - class: String @hidden - bar: Bars - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_A" - } - ] - when: { - result: { - sourceField: "type" - predicate: { equals: 1 } - } - } - ) - @hydrated( - service: "service2" - field: "barById" - arguments: [ - { - name: "id" - value: "BAR_B" - } - ] - when: { - result: { - sourceField: "class" - predicate: { startsWith: "A" } - } - } - ) - } - union Bars = Bar -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - type: Int - class: String - } - union Bars = Bar - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - id: ID - type: Int - class: String - } - - type Query { - foo: Foo - } -query: | - query { - foo { - bar { - ... on Bar { - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - query: | - query { - foo { - __typename__hydration__bar: __typename - hydration__bar__class: class - hydration__bar__type: type - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__bar": "Foo", - "hydration__bar__class": "ABC_123", - "hydration__bar__type": 2 - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_A"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar A" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"BAR_B"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar B" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar B" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml b/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml deleted file mode 100644 index 0a4c98dda..000000000 --- a/test/src/test/resources/fixtures/new hydration/nested-list-hydration-under-a-renamed-top-level-field.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: "nested list hydration under a renamed top level field" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - fooService: FooService @renamed(from: "service") - - connection(id: ID): Connection - node(id: ID): Node - space(id: ID): Space - } - type FooService @renamed(from: "Service") { - otherServices: Connection - @hydrated( - service: "Foo" - field: "connection" - arguments: [{name: "id" value: "$source.id"}] - ) - } - type Connection { - edges: [Edge] - nodes: [Node] - @hydrated( - service: "Foo" - field: "node" - arguments: [{name: "id" value: "$source.edges.node"}] - ) - } - type Node { - space: Space - @hydrated( - service: "Foo" - field: "space" - arguments: [{name: "id" value: "$source.id"}] - ) - id: ID - } - type Space { - id: ID - name: String - } - type Edge { - node: Node - @hydrated( - service: "Foo" - field: "node" - arguments: [{name: "id" value: "$source.node"}] - ) - name: String - id: ID - } -# language=GraphQL -underlyingSchema: - Foo: | - type Connection { - edges: [Edge] - nodes: [ID] - } - - type Edge { - id: ID - name: String - node: ID - } - - type Node { - detailId: ID! - id: ID - name: String - } - - type Query { - connection(id: ID): Connection - node(id: ID): Node - service: Service - space(id: ID): Space - } - - type Service { - id: ID - } - - type Space { - id: ID - name: String - } -# language=GraphQL -query: | - query { - fooService { - otherServices { - nodes { - space { - id - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - rename__fooService__service: service { - __typename__hydration__otherServices: __typename - hydration__otherServices__id: id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "rename__fooService__service": { - "__typename__hydration__otherServices": "Service", - "hydration__otherServices__id": "ID" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - connection(id: $v0) { - __typename__hydration__nodes: __typename - hydration__nodes__edges: edges { - node - } - } - } - variables: {"v0":"ID"} - # language=JSON - response: |- - { - "data": { - "connection": { - "__typename__hydration__nodes": "Connection", - "hydration__nodes__edges": [ - { - "node": "1" - } - ] - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - node(id: $v0) { - __typename__hydration__space: __typename - hydration__space__id: id - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "node": { - "hydration__space__id": "1a", - "__typename__hydration__space": "Node" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - space(id: $v0) { - id - } - } - variables: {"v0":"1a"} - # language=JSON - response: |- - { - "data": { - "space": { - "id": "apple" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "fooService": { - "otherServices": { - "nodes": [ - { - "space": { - "id": "apple" - } - } - ] - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml b/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml deleted file mode 100644 index 1f7996a42..000000000 --- a/test/src/test/resources/fixtures/new hydration/new-batched-with-null-value-in-source-array.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: new batched with null value in source array -enabled: true -# language=GraphQL -overallSchema: - Issues: | - type Query { - issueById(id: ID!): Issue! - } - type Issue { - id: ID! - key: String - collaborators: [User] - @hydrated( - service: "Users" - field: "usersByIds" - arguments: [ - {name: "ids", value: "$source.collaboratorIds"} - ] - identifiedBy: "id" - ) - } - Users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -underlyingSchema: - Issues: | - type Query { - issueById(id: ID!): Issue! - } - type Issue { - id: ID! - key: String - collaboratorIds: [ID] - } - Users: | - type Query { - usersByIds(ids: [ID!]!): [User] - } - type User { - id: ID! - name: String - } -# language=GraphQL -query: | - query { - issueById(id: "10000") { - key - collaborators { - __typename - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__batch_hydration__collaborators: __typename - batch_hydration__collaborators__collaboratorIds: collaboratorIds - key - } - } - variables: {"v0":"10000"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "key": "GQLGW-1000", - "batch_hydration__collaborators__collaboratorIds": [ - "100", - null, - "200" - ], - "__typename__batch_hydration__collaborators": "Issue" - } - } - } - - serviceName: "Users" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - usersByIds(ids: $v0) { - __typename - batch_hydration__collaborators__id: id - name - } - } - variables: {"v0":["100","200"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "__typename": "User", - "name": "John Doe", - "batch_hydration__collaborators__id": "100" - }, - { - "__typename": "User", - "name": "Joe", - "batch_hydration__collaborators__id": "200" - } - ] - } - } -# language=JSON -response: | - { - "data": { - "issueById": { - "key": "GQLGW-1000", - "collaborators": [ - { - "__typename": "User", - "name": "John Doe" - }, - { - "__typename": "User", - "name": "Joe" - } - ] - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml b/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml deleted file mode 100644 index 4bfd45bc3..000000000 --- a/test/src/test/resources/fixtures/new hydration/nullable-argument-for-hydration-is-missing.yml +++ /dev/null @@ -1,165 +0,0 @@ -name: "nullable argument for hydration is missing" -enabled: true -# language=GraphQL -overallSchema: - boards: | - type Query { - board: Board - } - - type Board { - id: ID - issue: Issue - @hydrated( - service: "issues" - field: "issue" - arguments: [{ name: "id", value: "$source.issueId"}] - ) - } - issues: | - type Query { - issue(id: ID): Issue - } - - type Issue { - id: ID! - cloudId: ID! - - comments(after: String): CommentConnection - @hydrated( - service: "comments" - field: "comments" - arguments: [ - {name:"cloudId" value:"$source.cloudId"} - {name:"after" value:"$argument.after"} - ] - ) - } - comments: | - type Query { - comments(cloudId: ID!, after: String): CommentConnection - } - - type CommentConnection { - totalCount: Int - } -# language=GraphQL -underlyingSchema: - boards: | - type Query { - board: Board - } - - type Board { - id: ID - issueId: ID! - } - issues: | - type Query { - issue(id: ID): Issue - } - - type Issue { - id: ID! - cloudId: ID! - } - comments: | - type Query { - comments(cloudId: ID!, after: String): CommentConnection - } - - type CommentConnection { - totalCount: Int - } -# language=GraphQL -query: | - query { - board { - issue { - comments { - totalCount - } - } - } - } -variables: - first: 10 -serviceCalls: - - serviceName: "boards" - request: - # language=GraphQL - query: | - { - board { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "board": { - "hydration__issue__issueId": "ISSUE-1", - "__typename__hydration__issue": "Board" - } - }, - "extensions": {} - } - - serviceName: "issues" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(id: $v0) { - __typename__hydration__comments: __typename - hydration__comments__cloudId: cloudId - } - } - variables: {"v0":"ISSUE-1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__comments__cloudId": "CLOUD_ID-1", - "__typename__hydration__comments": "Issue" - } - }, - "extensions": {} - } - - serviceName: "comments" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - comments(cloudId: $v0) { - totalCount - } - } - variables: {"v0":"CLOUD_ID-1"} - # language=JSON - response: |- - { - "data": { - "comments": { - "totalCount": 10 - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "board": { - "issue": { - "comments": { - "totalCount": 10 - } - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml deleted file mode 100644 index 16c5dc9d6..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-fragments-defined.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: "one hydration call with fragments defined" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - ...frag1 - } - } - - fragment frag1 on Foo { - bar { - id - name - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - id - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1", - "id": "barId" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "id": "barId", - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml deleted file mode 100644 index f4e80d44a..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-input-value-having-longer-path.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: "one hydration call with input value having longer path" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - barLongerInput { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__barLongerInput: __typename - hydration__barLongerInput__fooDetails: fooDetails { - externalBarId - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__barLongerInput__fooDetails": { - "externalBarId": "barId" - }, - "__typename__hydration__barLongerInput": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "barLongerInput": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml deleted file mode 100644 index ef5baae34..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-and-same-named-overall-field.yml +++ /dev/null @@ -1,173 +0,0 @@ -name: "one hydration call with longer path and same named overall field" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authorDetails: [AuthorDetail] - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authorDetails.authorId"}] - identifiedBy: "id" - batchSize: 2 - ) - } - type AuthorDetail { - name: String - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - name: String - } - Issues: | - type AuthorDetail { - authorId: ID - name: String - } - - type Issue { - authorDetails: [AuthorDetail] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - authorDetails { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorDetails: authorDetails { - authorId - } - authorDetails { - name - } - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1", - "batch_hydration__authors__authorDetails": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "authorDetails": [ - { - "name": "User 1" - }, - { - "name": "User 2" - } - ] - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - variables: {"v0":["USER-1","USER-2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authorDetails": [ - { - "name": "User 1" - }, - { - "name": "User 2" - } - ], - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml deleted file mode 100644 index 0da94afe2..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-longer-path-arguments-and-merged-fields.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: "one hydration call with longer path arguments and merged fields" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "UserService" - field: "usersByIds" - arguments: [{name: "id" value: "$source.authors.authorId"}] - identifiedBy: "id" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersByIds(id: [ID]): [User] - } - - type User { - id: ID - name: String - } - Issues: | - type Issue { - authorIds: [ID] - authors: [IssueUser] - id: ID - } - - type IssueUser { - authorId: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authors: authors { - authorId - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__authors__authors": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - name - } - } - variables: {"v0":["USER-1","USER-2"]} - # language=JSON - response: |- - { - "data": { - "usersByIds": [ - { - "name": "User 1", - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "name": "User 2", - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "User 1", - "id": "USER-1" - }, - { - "name": "User 2", - "id": "USER-2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml b/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml deleted file mode 100644 index 39d2ac49f..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-hydration-call-with-variables-defined.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: "one hydration call with variables defined" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo(id: ID): Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo(id: ID): Foo - } -# language=GraphQL -query: | - query($var: ID) { - foo(id: $var) { - bar { - id - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - id - name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "id": "barId", - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "id": "barId", - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml b/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml deleted file mode 100644 index 72d26c2e3..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-and-same-named-overall-field.yml +++ /dev/null @@ -1,184 +0,0 @@ -name: "one synthetic hydration call with longer path and same named overall field" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersQuery: UserQuery - } - type UserQuery { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authorDetails: [AuthorDetail] - authors: [User] - @hydrated( - service: "UserService" - field: "usersQuery.usersByIds" - arguments: [{name: "id" value: "$source.authorDetails.authorId"}] - identifiedBy: "id" - batchSize: 2 - ) - } - type AuthorDetail { - name: String - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersQuery: UserQuery - } - - type User { - id: ID - name: String - } - - type UserQuery { - usersByIds(id: [ID]): [User] - } - Issues: | - type AuthorDetail { - authorId: ID - name: String - } - - type Issue { - authorDetails: [AuthorDetail] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - authorDetails { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - query { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorDetails: authorDetails { - authorId - } - authorDetails { - name - } - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1", - "batch_hydration__authors__authorDetails": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "authorDetails": [ - { - "name": "User 1" - }, - { - "name": "User 2" - } - ] - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersQuery { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-1","USER-2"]} - # language=JSON - response: |- - { - "data": { - "usersQuery": { - "usersByIds": [ - { - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authorDetails": [ - { - "name": "User 1" - }, - { - "name": "User 2" - } - ], - "authors": [ - { - "id": "USER-1" - }, - { - "id": "USER-2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml b/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml deleted file mode 100644 index 78ec25f51..000000000 --- a/test/src/test/resources/fixtures/new hydration/one-synthetic-hydration-call-with-longer-path-arguments-and-merged-fields-and-renamed-type.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: "one synthetic hydration call with longer path arguments and merged fields and renamed type" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersQuery: RenamedUserQuery - } - type RenamedUserQuery @renamed(from: "UserQuery") { - usersByIds(id: [ID]): [RenamedUser] - } - type RenamedUser @renamed(from: "User") { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [RenamedUser] - @hydrated( - service: "UserService" - field: "usersQuery.usersByIds" - arguments: [{name: "id" value: "$source.authors.authorId"}] - identifiedBy: "id" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersQuery: UserQuery - } - - type User { - id: ID - name: String - } - - type UserQuery { - usersByIds(id: [ID]): [User] - } - Issues: | - type Issue { - authorIds: [ID] - authors: [IssueUser] - id: ID - } - - type IssueUser { - authorId: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - name - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authors: authors { - authorId - } - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "batch_hydration__authors__authors": [ - { - "authorId": "USER-1" - }, - { - "authorId": "USER-2" - } - ], - "__typename__batch_hydration__authors": "Issue", - "id": "ISSUE-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - usersQuery { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - name - } - } - } - variables: {"v0":["USER-1","USER-2"]} - # language=JSON - response: |- - { - "data": { - "usersQuery": { - "usersByIds": [ - { - "name": "User 1", - "id": "USER-1", - "batch_hydration__authors__id": "USER-1" - }, - { - "name": "User 2", - "id": "USER-2", - "batch_hydration__authors__id": "USER-2" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - { - "name": "User 1", - "id": "USER-1" - }, - { - "name": "User 2", - "id": "USER-2" - } - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml deleted file mode 100644 index d474caa56..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service-return-types-implement-same-interface.yml +++ /dev/null @@ -1,265 +0,0 @@ -name: "batch polymorphic hydration actor fields are in the same service return types implement same interface" -enabled: true -# language=GraphQL -overallSchema: - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "bar" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "bar" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human - bar: | - type Query { - petById(ids: [ID]): [Pet] - humanById(ids: [ID]): [Human] - } - - interface Node { - id: ID - } - - type Human implements Node { - id: ID - name: String - } - - type Pet implements Node { - id: ID - breed: String - } -# language=GraphQL -underlyingSchema: - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } - bar: | - type Query { - petById(ids: [ID]): [Pet] - humanById(ids: [ID]): [Human] - } - - interface Node { - id: ID - } - - type Human implements Node { - id: ID - name: String - } - - type Pet implements Node { - id: ID - breed: String - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "breed": "Akita", - "id": "PET-0", - "batch_hydration__data__id": "PET-0" - }, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - } - ] - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "id": "PET-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml deleted file mode 100644 index c2d9be026..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-actor-fields-are-in-the-same-service.yml +++ /dev/null @@ -1,257 +0,0 @@ -name: "batch polymorphic hydration actor fields are in the same service" -enabled: true -# language=GraphQL -overallSchema: - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "bar" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "bar" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human - bar: | - type Query { - petById(ids: [ID]): [Pet] - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - - type Pet { - id: ID - breed: String - } -# language=GraphQL -underlyingSchema: - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } - bar: | - type Query { - petById(ids: [ID]): [Pet] - humanById(ids: [ID]): [Human] - } - - type Pet { - id: ID - breed: String - } - - type Human { - id: ID - name: String - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "breed": "Akita", - "id": "PET-0", - "batch_hydration__data__id": "PET-0" - }, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - } - ] - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "id": "PET-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml deleted file mode 100644 index c45fcd33f..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array-with-error.yml +++ /dev/null @@ -1,268 +0,0 @@ -name: "batch polymorphic hydration return null in array with error" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - null, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - } - ] - }, - "errors": [ - { - "message": "invalid id PET-0" - } - ], - "extensions": {} - } - -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "errors": [ - { - "message": "invalid id PET-0", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml deleted file mode 100644 index 182d7b1a6..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-null-in-array.yml +++ /dev/null @@ -1,254 +0,0 @@ -name: "batch polymorphic hydration return null in array" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - null, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml deleted file mode 100644 index 101b45465..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null-and-error.yml +++ /dev/null @@ -1,254 +0,0 @@ -name: "batch polymorphic hydration return top level null and error" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": null, - "errors": [ - { - "message": "something went wrong" - } - ], - "extensions": {} - } - -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "errors": [ - { - "message": "something went wrong", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ] - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml deleted file mode 100644 index 706a47819..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-return-top-level-null.yml +++ /dev/null @@ -1,240 +0,0 @@ -name: "batch polymorphic hydration return top level null" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": null, - "extensions": {} - } - -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - } - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml deleted file mode 100644 index 4f047d23d..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null-1.yml +++ /dev/null @@ -1,253 +0,0 @@ -name: "batch polymorphic hydration when hook returns null 1" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "NULL-1", - "batch_hydration__data__dataId": "NULL-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "breed": "Akita", - "id": "PET-0", - "batch_hydration__data__id": "PET-0" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml deleted file mode 100644 index 1f2ed86b7..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-when-hook-returns-null.yml +++ /dev/null @@ -1,217 +0,0 @@ -name: "batch polymorphic hydration when hook returns null" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "NULL-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "NULL-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml deleted file mode 100644 index 9f78b4438..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-where-only-one-type-is-queried.yml +++ /dev/null @@ -1,253 +0,0 @@ -name: "batch polymorphic hydration where only one type is queried" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Fish { - id: ID - fins: Int - } - - type Dog { - id: ID - breed: String - } - - union Pet = Fish | Dog - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: LivingThing - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "id" - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "id" - ) - } - - union LivingThing = Human | Fish | Dog -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Fish { - id: ID - fins: Int - } - - type Dog { - id: ID - breed: String - } - - union Pet = Fish | Dog - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - data { - ... on Fish { - __typename - id - fins - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "DOG-0", - "batch_hydration__data__dataId": "DOG-0" - }, - { - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "FISH-0", - "batch_hydration__data__dataId": "FISH-0" - }, - { - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "DOG-1", - "batch_hydration__data__dataId": "DOG-1" - }, - { - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "FISH-1", - "batch_hydration__data__dataId": "FISH-1" - }, - { - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - ... on Dog { - batch_hydration__data__id: id - } - ... on Fish { - __typename - fins - id - batch_hydration__data__id: id - } - } - } - variables: {"v0":["DOG-0","FISH-0","DOG-1","FISH-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "batch_hydration__data__id": "DOG-0" - }, - { - "__typename": "Fish", - "fins": 4, - "id": "FISH-0", - "batch_hydration__data__id": "FISH-0" - }, - { - "batch_hydration__data__id": "DOG-1" - }, - { - "__typename": "Fish", - "fins": 8, - "id": "FISH-1", - "batch_hydration__data__id": "FISH-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - batch_hydration__data__id: id - } - } - variables: {"v0":["HUMAN-0"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "batch_hydration__data__id": "HUMAN-0" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "data": {} - }, - { - "data": { - "__typename": "Fish", - "id": "FISH-0", - "fins": 4 - } - }, - { - "data": {} - }, - { - "data": { - "__typename": "Fish", - "id": "FISH-1", - "fins": 8 - } - }, - { - "data": {} - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml deleted file mode 100644 index f9be64a5e..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-conditions.yml +++ /dev/null @@ -1,271 +0,0 @@ -name: "batch polymorphic hydration with conditions" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - when: { - result: { - sourceField: "dataId" - predicate: { matches: "PET.*" } - } - } - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - when: { - result: { - sourceField: "dataId" - predicate: { matches: "HUMAN.*" } - } - } - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "breed": "Akita", - "id": "PET-0", - "batch_hydration__data__id": "PET-0" - }, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - }] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - }] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "id": "PET-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - }] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml deleted file mode 100644 index c226628df..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-interfaces.yml +++ /dev/null @@ -1,310 +0,0 @@ -name: "batch polymorphic hydration with interfaces" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Fish implements Pet { - id: ID - fins: Int - } - - type Dog implements Pet { - id: ID - breed: String - } - - interface Pet { - id: ID - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: LivingThing - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "id" - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "id" - ) - } - - union LivingThing = Human | Fish | Dog -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Fish implements Pet { - id: ID - fins: Int - } - - type Dog implements Pet { - id: ID - breed: String - } - - interface Pet { - id: ID - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Dog { - __typename - id - breed - } - ... on Fish { - __typename - id - fins - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "DOG-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "FISH-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "DOG-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "FISH-1", - "id": "FOO-3" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-4" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - ... on Dog { - breed - } - ... on Fish { - fins - } - } - } - variables: {"v0":["DOG-0","FISH-0","DOG-1","FISH-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Dog", - "breed": "Akita", - "id": "DOG-0", - "batch_hydration__data__id": "DOG-0" - }, - { - "__typename": "Fish", - "fins": 4, - "id": "FISH-0", - "batch_hydration__data__id": "FISH-0" - }, - { - "__typename": "Dog", - "breed": "Labrador", - "id": "DOG-1", - "batch_hydration__data__id": "DOG-1" - }, - { - "__typename": "Fish", - "fins": 8, - "id": "FISH-1", - "batch_hydration__data__id": "FISH-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Dog", - "id": "DOG-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Fish", - "id": "FISH-0", - "fins": 4 - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Dog", - "id": "DOG-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Fish", - "id": "FISH-1", - "fins": 8 - } - }, - { - "__typename": "Foo", - "id": "FOO-4", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml deleted file mode 100644 index c75796521..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-lots-of-renames.yml +++ /dev/null @@ -1,272 +0,0 @@ -name: "batch polymorphic hydration with lots of renames" -enabled: true -# language=GraphQL -overallSchema: - bar: | - type Query { - animalById(ids: [ID]): [Animal] @renamed(from: "petById") - petById(ids: [ID]): [Animal] - personById(ids: [ID]): [Person] @renamed(from: "humanById") - humanById(ids: [ID]): [Person] - } - - type Animal @renamed(from: "Pet") { - id: ID @renamed(from: "identifier") - breed: String @renamed(from: "kind") - } - - type Person @renamed(from: "Human") { - id: ID @renamed(from: "identifier") - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "bar" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "hiddenId" - ) - @hydrated( - service: "bar" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "hiddenId" - ) - } - - union Data = Animal | Person -# language=GraphQL -underlyingSchema: - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } - bar: | - type Query { - humanById(ids: [ID]): [Human] - petById(ids: [ID]): [Pet] - } - - type Human { - hiddenId: ID - identifier: ID - name: String - } - - type Pet { - hiddenId: ID - identifier: ID - kind: String - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Animal { - __typename - id - breed - } - ... on Person { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - __typename__rename__id: __typename - batch_hydration__data__hiddenId: hiddenId - rename__id__identifier: identifier - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "__typename__rename__id": "Human", - "batch_hydration__data__hiddenId": "HUMAN-0", - "rename__id__identifier": "PERSON-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "__typename__rename__id": "Human", - "batch_hydration__data__hiddenId": "HUMAN-1", - "rename__id__identifier": "PERSON-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - __typename__rename__id: __typename - __typename__rename__breed: __typename - batch_hydration__data__hiddenId: hiddenId - rename__id__identifier: identifier - rename__breed__kind: kind - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "__typename__rename__id": "Pet", - "__typename__rename__breed": "Pet", - "batch_hydration__data__hiddenId": "PET-0", - "rename__id__identifier": "ANIMAL-0", - "rename__breed__kind": "Akita" - }, - { - "__typename": "Pet", - "__typename__rename__id": "Pet", - "__typename__rename__breed": "Pet", - "batch_hydration__data__hiddenId": "PET-1", - "rename__id__identifier": "ANIMAL-1", - "rename__breed__kind": "Labrador" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Animal", - "id": "ANIMAL-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Person", - "id": "PERSON-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Animal", - "id": "ANIMAL-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Person", - "id": "PERSON-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml deleted file mode 100644 index 85c424bdc..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-rename.yml +++ /dev/null @@ -1,266 +0,0 @@ -name: "batch polymorphic hydration with rename" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String @renamed(from: "kind") - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human @renamed(from: "Person") { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - kind: String - } - people: | - type Query { - humanById(ids: [ID]): [Person] - } - - type Person { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - __typename__rename__breed: __typename - id - batch_hydration__data__id: id - rename__breed__kind: kind - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "__typename__rename__breed": "Pet", - "id": "PET-0", - "batch_hydration__data__id": "PET-0", - "rename__breed__kind": "Akita" - }, - { - "__typename": "Pet", - "__typename__rename__breed": "Pet", - "id": "PET-1", - "batch_hydration__data__id": "PET-1", - "rename__breed__kind": "Labrador" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Person", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Person", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "id": "PET-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml deleted file mode 100644 index 7ac2b7f54..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration-with-unions.yml +++ /dev/null @@ -1,308 +0,0 @@ -name: "batch polymorphic hydration with unions" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Fish { - id: ID - fins: Int - } - - type Dog { - id: ID - breed: String - } - - union Pet = Fish | Dog - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: LivingThing - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "id" - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - identifiedBy: "id" - ) - } - - union LivingThing = Human | Fish | Dog -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Fish { - id: ID - fins: Int - } - - type Dog { - id: ID - breed: String - } - - union Pet = Fish | Dog - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Dog { - __typename - id - breed - } - ... on Fish { - __typename - id - fins - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "DOG-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "FISH-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "DOG-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "FISH-1", - "id": "FOO-3" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-4" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - ... on Dog { - breed - id - batch_hydration__data__id: id - } - ... on Fish { - fins - id - batch_hydration__data__id: id - } - } - } - variables: {"v0":["DOG-0","FISH-0","DOG-1","FISH-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Dog", - "breed": "Akita", - "id": "DOG-0", - "batch_hydration__data__id": "DOG-0" - }, - { - "__typename": "Fish", - "fins": 4, - "id": "FISH-0", - "batch_hydration__data__id": "FISH-0" - }, - { - "__typename": "Dog", - "breed": "Labrador", - "id": "DOG-1", - "batch_hydration__data__id": "DOG-1" - }, - { - "__typename": "Fish", - "fins": 8, - "id": "FISH-1", - "batch_hydration__data__id": "FISH-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Dog", - "id": "DOG-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Fish", - "id": "FISH-0", - "fins": 4 - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Dog", - "id": "DOG-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Fish", - "id": "FISH-1", - "fins": 8 - } - }, - { - "__typename": "Foo", - "id": "FOO-4", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml deleted file mode 100644 index 404deae46..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydration.yml +++ /dev/null @@ -1,263 +0,0 @@ -name: "batch polymorphic hydration" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "breed": "Akita", - "id": "PET-0", - "batch_hydration__data__id": "PET-0" - }, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "id": "PET-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml deleted file mode 100644 index 35b7a1222..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/batch-polymorphic-hydrations-are-executed-in-parallel.yml +++ /dev/null @@ -1,259 +0,0 @@ -name: "batch polymorphic hydrations are executed in parallel" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "ids" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(ids: [ID]): [Pet] - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(ids: [ID]): [Human] - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - { - foo { - __typename - __typename__batch_hydration__data: __typename - batch_hydration__data__dataId: dataId - batch_hydration__data__dataId: dataId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "PET-1", - "id": "FOO-2" - }, - { - "__typename": "Foo", - "__typename__batch_hydration__data": "Foo", - "batch_hydration__data__dataId": "HUMAN-1", - "id": "FOO-3" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - petById(ids: $v0) { - __typename - breed - id - batch_hydration__data__id: id - } - } - variables: {"v0":["PET-0","PET-1"]} - # language=JSON - response: |- - { - "data": { - "petById": [ - { - "__typename": "Pet", - "breed": "Akita", - "id": "PET-0", - "batch_hydration__data__id": "PET-0" - }, - { - "__typename": "Pet", - "breed": "Labrador", - "id": "PET-1", - "batch_hydration__data__id": "PET-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - humanById(ids: $v0) { - __typename - id - batch_hydration__data__id: id - name - } - } - variables: {"v0":["HUMAN-0","HUMAN-1"]} - # language=JSON - response: |- - { - "data": { - "humanById": [ - { - "__typename": "Human", - "id": "HUMAN-0", - "batch_hydration__data__id": "HUMAN-0", - "name": "Fanny Longbottom" - }, - { - "__typename": "Human", - "id": "HUMAN-1", - "batch_hydration__data__id": "HUMAN-1", - "name": "John Doe" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - { - "__typename": "Foo", - "id": "FOO-2", - "data": { - "__typename": "Pet", - "id": "PET-1", - "breed": "Labrador" - } - }, - { - "__typename": "Foo", - "id": "FOO-3", - "data": { - "__typename": "Human", - "id": "HUMAN-1", - "name": "John Doe" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml deleted file mode 100644 index 1215e4a7a..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/polymorphic-hydration-instructions-use-different-inputs.yml +++ /dev/null @@ -1,279 +0,0 @@ -name: "polymorphic hydration instructions use different inputs" -enabled: true -# language=GraphQL -overallSchema: - Pets: | - type Query { - petsByIds(ids: [ID!]!): [Pet] - } - - union Animal = Dog | Cat | Giraffe - type Pet { - animal: Animal - @hydrated( - service: "Dogs" - field: "dogsByIds" - arguments: [{ name: "ids", value: "$source.animalId"}] - identifiedBy: "id" - batchSize: 90 - ) - @hydrated( - service: "Cats" - field: "cats.catsByIds" - arguments: [{ name: "ids", value: "$source.animalId"}] - identifiedBy: "id" - batchSize: 90 - ) - @hydrated( - service: "Zoo" - field: "giraffes" - arguments: [{ name: "filters", value: "$source.giraffeInput"}] - inputIdentifiedBy: [ - {sourceId: "giraffeInput.nickname", resultId: "nickname"} - {sourceId: "giraffeInput.birthday", resultId: "birthday"} - {sourceId: "giraffeInput.height", resultId: "height"} - ] - batchSize: 90 - ) - } - Dogs: | - type Query { - dogsByIds(ids: [ID!]!): [Dog] - } - - type Dog { - id: ID! - name: String - } - Cats: | - type Query { - cats: CatQuery - } - - type CatQuery { - catsByIds(ids: [ID!]!): [Cat] - } - - type Cat { - id: ID! - name: String - } - Zoo: | - type Query { - giraffes(filters: [GiraffeFilter]): [Giraffe] - } - input GiraffeFilter { - nickname: String! - birthday: Int! - height: Int! - } - type Giraffe { - id: ID! - name: String - nickname: String - birthday: Int - height: Int - } -# language=GraphQL -underlyingSchema: - Pets: | - type Query { - petsByIds(ids: [ID!]!): [Pet] - } - - type Pet { - animalId: ID! - giraffeInput: PetGiraffeInput - } - type PetGiraffeInput { - nickname: String! - birthday: Int! - height: Int! - } - Dogs: | - type Query { - dogsByIds(ids: [ID!]!): [Dog] - } - - type Dog { - id: ID! - name: String - } - Cats: | - type Query { - cats: CatQuery - } - - type CatQuery { - catsByIds(ids: [ID!]!): [Cat] - } - - type Cat { - id: ID! - name: String - } - Zoo: | - type Query { - giraffes(filters: [GiraffeFilter]): [Giraffe] - } - input GiraffeFilter { - nickname: String! - birthday: Int! - height: Int! - } - type Giraffe { - id: ID! - name: String - nickname: String - birthday: Int - height: Int - } -# language=GraphQL -query: | - query { - petsByIds(ids: ["good-boye-1", "tall-boye-9"]) { - animal { - __typename - ... on Dog { - name - } - ... on Cat { - name - } - ... on Giraffe { - name - birthday - height - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Pets" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - petsByIds(ids: $v0) { - __typename__batch_hydration__animal: __typename - batch_hydration__animal__animalId: animalId - batch_hydration__animal__animalId: animalId - batch_hydration__animal__giraffeInput: giraffeInput { - nickname - } - batch_hydration__animal__giraffeInput: giraffeInput { - birthday - } - batch_hydration__animal__giraffeInput: giraffeInput { - height - } - } - } - variables: {"v0":["good-boye-1","tall-boye-9"]} - # language=JSON - response: |- - { - "data": { - "petsByIds": [ - { - "__typename__batch_hydration__animal": "Pet", - "batch_hydration__animal__animalId": "good-boye-1", - "batch_hydration__animal__giraffeInput": null - }, - { - "__typename__batch_hydration__animal": "Pet", - "batch_hydration__animal__animalId": "tall-boye-9", - "batch_hydration__animal__giraffeInput": { - "nickname": "Tall Boye", - "birthday": 1001203200, - "height": 570 - } - } - ] - }, - "extensions": {} - } - - serviceName: "Dogs" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - dogsByIds(ids: $v0) { - __typename - batch_hydration__animal__id: id - name - } - } - variables: {"v0":["good-boye-1"]} - # language=JSON - response: |- - { - "data": { - "dogsByIds": [ - { - "__typename": "Dog", - "batch_hydration__animal__id": "good-boye-1", - "name": "Abe" - } - ] - }, - "extensions": {} - } - - serviceName: "Zoo" - request: - # language=GraphQL - query: | - query ($v0: [GiraffeFilter]) { - giraffes(filters: $v0) { - __typename - birthday - batch_hydration__animal__birthday: birthday - height - batch_hydration__animal__height: height - name - batch_hydration__animal__nickname: nickname - } - } - variables: {"v0":[{"nickname":"Tall Boye","birthday":1001203200,"height":570}]} - # language=JSON - response: |- - { - "data": { - "giraffes": [ - { - "__typename": "Giraffe", - "birthday": 1001203200, - "batch_hydration__animal__birthday": 1001203200, - "height": 570, - "batch_hydration__animal__height": 570, - "name": "Rukiya", - "batch_hydration__animal__nickname": "Tall Boye" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "petsByIds": [ - { - "animal": { - "__typename": "Dog", - "name": "Abe" - } - }, - { - "animal": { - "__typename": "Giraffe", - "birthday": 1001203200, - "height": 570, - "name": "Rukiya" - } - } - ] - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml deleted file mode 100644 index cd89f0f35..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration-when-hook-returns-null.yml +++ /dev/null @@ -1,185 +0,0 @@ -name: "solitary polymorphic hydration when hook returns null" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(id: ID): Pet - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(id: ID): Human - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "id" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "id" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(id: ID): Pet - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(id: ID): Human - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename - __typename__hydration__data: __typename - hydration__data__dataId: dataId - hydration__data__dataId: dataId - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__hydration__data": "Foo", - "hydration__data__dataId": "NULL-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__hydration__data": "Foo", - "hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - } - ] - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: ID) { - humanById(id: $v0) { - __typename - __typename__type_filter__id: __typename - __typename__type_filter__breed: __typename - id - name - } - } - variables: {"v0":"HUMAN-0"} - # language=JSON - response: |- - { - "data": { - "humanById": { - "__typename": "Human", - "__typename__type_filter__id": "Human", - "__typename__type_filter__breed": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": null - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml b/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml deleted file mode 100644 index 05fd37774..000000000 --- a/test/src/test/resources/fixtures/new hydration/polymorphic hydrations/solitary-polymorphic-hydration.yml +++ /dev/null @@ -1,217 +0,0 @@ -name: "solitary polymorphic hydration" -enabled: true -# language=GraphQL -overallSchema: - pets: | - type Query { - petById(id: ID): Pet - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(id: ID): Human - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - data: Data - @hydrated( - service: "pets" - field: "petById" - arguments: [ - {name: "id" value: "$source.dataId"} - ] - ) - @hydrated( - service: "people" - field: "humanById" - arguments: [ - {name: "id" value: "$source.dataId"} - ] - ) - } - - union Data = Pet | Human -# language=GraphQL -underlyingSchema: - pets: | - type Query { - petById(id: ID): Pet - } - - type Pet { - id: ID - breed: String - } - people: | - type Query { - humanById(id: ID): Human - } - - type Human { - id: ID - name: String - } - foo: | - type Query { - foo: [Foo] - } - - type Foo { - id: ID - dataId: ID - } -# language=GraphQL -query: | - query { - foo { - __typename - id - data { - ... on Pet { - __typename - id - breed - } - ... on Human { - __typename - id - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename - __typename__hydration__data: __typename - hydration__data__dataId: dataId - hydration__data__dataId: dataId - id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "__typename__hydration__data": "Foo", - "hydration__data__dataId": "PET-0", - "id": "FOO-0" - }, - { - "__typename": "Foo", - "__typename__hydration__data": "Foo", - "hydration__data__dataId": "HUMAN-0", - "id": "FOO-1" - } - ] - }, - "extensions": {} - } - - serviceName: "pets" - request: - # language=GraphQL - query: | - query ($v0: ID) { - petById(id: $v0) { - __typename - __typename__type_filter__id: __typename - __typename__type_filter__name: __typename - breed - id - } - } - variables: {"v0":"PET-0"} - # language=JSON - response: |- - { - "data": { - "petById": { - "__typename": "Pet", - "__typename__type_filter__id": "Pet", - "__typename__type_filter__name": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - "extensions": {} - } - - serviceName: "people" - request: - # language=GraphQL - query: | - query ($v0: ID) { - humanById(id: $v0) { - __typename - __typename__type_filter__id: __typename - __typename__type_filter__breed: __typename - id - name - } - } - variables: {"v0":"HUMAN-0"} - # language=JSON - response: |- - { - "data": { - "humanById": { - "__typename": "Human", - "__typename__type_filter__id": "Human", - "__typename__type_filter__breed": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": [ - { - "__typename": "Foo", - "id": "FOO-0", - "data": { - "__typename": "Pet", - "id": "PET-0", - "breed": "Akita" - } - }, - { - "__typename": "Foo", - "id": "FOO-1", - "data": { - "__typename": "Human", - "id": "HUMAN-0", - "name": "Fanny Longbottom" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml b/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml deleted file mode 100644 index 9294b3159..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-hydrated-interfaces-work-as-expected.yml +++ /dev/null @@ -1,298 +0,0 @@ -name: "query with hydrated interfaces work as expected" -enabled: true -# todo: handle synthetic fields in interfaces better -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - owners: [Owner] - @hydrated( - service: "OwnerService" - field: "ownerById" - arguments: [{name: "id" value: "$source.ownerIds"}] - ) - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - owners: [Owner] - @hydrated( - service: "OwnerService" - field: "ownerById" - arguments: [{name: "id" value: "$source.ownerIds"}] - ) - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - owners: [Owner] - @hydrated( - service: "OwnerService" - field: "ownerById" - arguments: [{name: "id" value: "$source.ownerIds"}] - ) - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - ownerById(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - ownerById(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - owners { - name - ... on CaringOwner { - givesPats - } - ... on CruelOwner { - givesSmacks - } - } - } - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - __typename__hydration__owners: __typename - name - ... on Cat { - hydration__owners__ownerIds: ownerIds - } - ... on Dog { - hydration__owners__ownerIds: ownerIds - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "hydration__owners__ownerIds": [ - "dearly" - ], - "__typename__hydration__owners": "Dog" - }, - { - "name": "Whiskers", - "hydration__owners__ownerIds": [ - "cruella" - ], - "__typename__hydration__owners": "Cat" - } - ] - }, - "extensions": {} - } - - serviceName: "OwnerService" - request: - # language=GraphQL - query: | - query petQ($v0: String) { - ownerById(id: $v0) { - name - ... on CaringOwner { - givesPats - } - ... on CruelOwner { - givesSmacks - } - } - } - variables: {"v0":"dearly"} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "ownerById": { - "name": "Mr Dearly", - "givesPats": true - } - }, - "extensions": {} - } - - serviceName: "OwnerService" - request: - # language=GraphQL - query: | - query petQ($v0: String) { - ownerById(id: $v0) { - name - ... on CaringOwner { - givesPats - } - ... on CruelOwner { - givesSmacks - } - } - } - variables: {"v0":"cruella"} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "ownerById": { - "name": "Cruella De Vil", - "givesSmacks": true - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "owners": [ - { - "name": "Mr Dearly", - "givesPats": true - } - ] - }, - { - "name": "Whiskers", - "owners": [ - { - "name": "Cruella De Vil", - "givesSmacks": true - } - ] - } - ] - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 14, - "serviceNodeCounts": { - "PetService": 8, - "OwnerService": 6 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml b/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml deleted file mode 100644 index b81dde230..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-hydration-that-fail-with-errors-are-reflected-in-the-result.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: "query with hydration that fail with errors are reflected in the result" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - bar: Bar - barById(id: ID): Bar - } - type Bar { - name: String - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barById" - arguments: [{name: "id" value: "$source.nestedBarId"}] - ) - } - Foo: | - type Query { - foo: Foo - } - type Foo { - name: String - bar: Bar - @hydrated( - service: "Bar" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - id: ID - name: String - nestedBarId: ID - } - - type Query { - bar: Bar - barById(id: ID): Bar - } - Foo: | - type Foo { - barId: ID - name: String - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - nestedBar { - name - nestedBar { - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId123", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - __typename__hydration__nestedBar: __typename - name - hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":"barId123"} - # language=JSON - response: |- - { - "errors": [ - { - "message": "Error during hydration" - } - ], - "data": { - "barById": null - }, - "extensions": {} - } -# language=JSON -response: |- - { - "errors": [ - { - "message": "Error during hydration", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ], - "data": { - "foo": { - "bar": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml b/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml deleted file mode 100644 index 802e8d9e1..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-synthetic-hydration-that-fail-with-errors-are-reflected-in-the-result.yml +++ /dev/null @@ -1,147 +0,0 @@ -name: "query with synthetic hydration that fail with errors are reflected in the result" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - barQuery: BarQuery - } - type BarQuery { - bar: Bar - barById(id: ID): Bar - } - type Bar { - name: String - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barQuery.barById" - arguments: [{name: "id" value: "$source.nestedBarId"}] - ) - } - Foo: | - type Query { - foo: Foo - } - type Foo { - name: String - bar: Bar - @hydrated( - service: "Bar" - field: "barQuery.barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - id: ID - name: String - nestedBarId: ID - } - - type BarQuery { - bar: Bar - barById(id: ID): Bar - } - - type Query { - barQuery: BarQuery - } - Foo: | - type Foo { - barId: ID - name: String - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - nestedBar { - name - nestedBar { - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId123", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barQuery { - barById(id: $v0) { - __typename__hydration__nestedBar: __typename - name - hydration__nestedBar__nestedBarId: nestedBarId - } - } - } - variables: {"v0":"barId123"} - # language=JSON - response: |- - { - "errors": [ - { - "message": "Error during hydration" - } - ], - "data": { - "barQuery": { - "barById": null - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "errors": [ - { - "message": "Error during hydration", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ], - "data": { - "foo": { - "bar": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml deleted file mode 100644 index e3cce108e..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data-and-lots-of-renames.yml +++ /dev/null @@ -1,326 +0,0 @@ -name: "query with three nested hydrations and simple data and lots of renames" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - ibar: Bar @renamed(from: "bar") - barsById(id: [ID]): [Bar] - } - type Bar { - barId: ID - barName: String @renamed(from: "name") - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barsById" - arguments: [{name: "id" value: "$source.nestedBarId"}] - identifiedBy: "barId" - ) - barDetails: BarDetails @renamed(from: "details") - } - type BarDetails @renamed(from: "Details") { - barAge: Int @renamed(from: "age") - barContact: BarContactDetails @renamed(from: "contact") - } - type BarContactDetails @renamed(from: "ContactDetails") { - barEmail: String @renamed(from: "email") - barPhone: Int @renamed(from: "phone") - } - Foo: | - type Query { - fooz: [Fooz] @renamed(from: "foos") - } - type Fooz @renamed(from: "Foo") { - fooDetails: FooDetails @renamed(from: "details") - bar: Bar - @hydrated( - service: "Bar" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "barId" - batchSize: 2 - ) - } - type FooDetails @renamed(from: "Details") { - fooName: String @renamed(from: "name") - fooAge: Int @renamed(from: "age") - fooContact: FooContactDetails @renamed(from: "contact") - } - type FooContactDetails @renamed(from: "ContactDetails") { - fooEmail: String @renamed(from: "email") - fooPhone: Int @renamed(from: "phone") - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - barId: ID - details: Details - name: String - nestedBarId: ID - } - - type ContactDetails { - email: String - phone: Int - } - - type Details { - age: Int - contact: ContactDetails - } - - type Query { - bar: Bar - barsById(id: [ID]): [Bar] - } - Foo: | - type ContactDetails { - email: String - phone: Int - } - - type Details { - age: Int - contact: ContactDetails - name: String - } - - type Foo { - barId: ID - details: Details - } - - type Query { - foos: [Foo] - } -# language=GraphQL -query: | - query { - fooz { - fooDetails { - fooName - fooAge - fooContact { - fooEmail - fooPhone - } - } - bar { - barName - nestedBar { - barName - nestedBar { - barName - barDetails { - barAge - barContact { - barEmail - barPhone - } - } - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - rename__fooz__foos: foos { - __typename__rename__fooDetails: __typename - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - rename__fooDetails__details: details { - __typename__rename__fooName: __typename - __typename__rename__fooAge: __typename - __typename__rename__fooContact: __typename - rename__fooAge__age: age - rename__fooContact__contact: contact { - __typename__rename__fooEmail: __typename - __typename__rename__fooPhone: __typename - rename__fooEmail__email: email - rename__fooPhone__phone: phone - } - rename__fooName__name: name - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "rename__fooz__foos": [ - { - "__typename__rename__fooDetails": "Foo", - "rename__fooDetails__details": { - "__typename__rename__fooContact": "Details", - "__typename__rename__fooName": "Details", - "rename__fooAge__age": 1, - "__typename__rename__fooAge": "Details", - "rename__fooContact__contact": { - "rename__fooPhone__phone": 1, - "rename__fooEmail__email": "test", - "__typename__rename__fooPhone": "ContactDetails", - "__typename__rename__fooEmail": "ContactDetails" - }, - "rename__fooName__name": "smith" - }, - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar1" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__rename__barName: __typename - __typename__batch_hydration__nestedBar: __typename - batch_hydration__bar__barId: barId - rename__barName__name: name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["bar1"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "batch_hydration__bar__barId": "bar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBar1", - "__typename__batch_hydration__nestedBar": "Bar", - "__typename__rename__barName": "Bar", - "rename__barName__name": "Bar 1" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__rename__barName: __typename - __typename__batch_hydration__nestedBar: __typename - batch_hydration__nestedBar__barId: barId - rename__barName__name: name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["nestedBar1"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "batch_hydration__nestedBar__barId": "nestedBar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBarId456", - "__typename__batch_hydration__nestedBar": "Bar", - "__typename__rename__barName": "Bar", - "rename__barName__name": "NestedBarName1" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__rename__barName: __typename - __typename__rename__barDetails: __typename - batch_hydration__nestedBar__barId: barId - rename__barDetails__details: details { - __typename__rename__barAge: __typename - __typename__rename__barContact: __typename - rename__barAge__age: age - rename__barContact__contact: contact { - __typename__rename__barEmail: __typename - __typename__rename__barPhone: __typename - rename__barEmail__email: email - rename__barPhone__phone: phone - } - } - rename__barName__name: name - } - } - variables: {"v0":["nestedBarId456"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "batch_hydration__nestedBar__barId": "nestedBarId456", - "rename__barDetails__details": { - "rename__barContact__contact": { - "rename__barPhone__phone": 1, - "rename__barEmail__email": "test", - "__typename__rename__barEmail": "ContactDetails", - "__typename__rename__barPhone": "ContactDetails" - }, - "rename__barAge__age": 1, - "__typename__rename__barContact": "Details", - "__typename__rename__barAge": "Details" - }, - "__typename__rename__barDetails": "Bar", - "__typename__rename__barName": "Bar", - "rename__barName__name": "NestedBarName2" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "fooz": [ - { - "fooDetails": { - "fooName": "smith", - "fooAge": 1, - "fooContact": { - "fooEmail": "test", - "fooPhone": 1 - } - }, - "bar": { - "barName": "Bar 1", - "nestedBar": { - "barName": "NestedBarName1", - "nestedBar": { - "barName": "NestedBarName2", - "barDetails": { - "barAge": 1, - "barContact": { - "barEmail": "test", - "barPhone": 1 - } - } - } - } - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml deleted file mode 100644 index 8a2215b6f..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-simple-data.yml +++ /dev/null @@ -1,198 +0,0 @@ -name: "query with three nested hydrations and simple data" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - bar: Bar - barsById(id: [ID]): [Bar] - } - type Bar { - barId: ID - name: String - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barsById" - arguments: [{name: "id" value: "$source.nestedBarId"}] - identifiedBy: "barId" - ) - } - Foo: | - type Query { - foos: [Foo] - } - type Foo { - name: String - bar: Bar - @hydrated( - service: "Bar" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "barId" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - barId: ID - name: String - nestedBarId: ID - } - - type Query { - bar: Bar - barsById(id: [ID]): [Bar] - } - Foo: | - type Foo { - barId: ID - name: String - } - - type Query { - foos: [Foo] - } -# language=GraphQL -query: | - query { - foos { - bar { - name - nestedBar { - name - nestedBar { - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foos { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar1" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__bar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["bar1"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "Bar 1", - "batch_hydration__bar__barId": "bar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBar1", - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__nestedBar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["nestedBar1"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "NestedBarName1", - "batch_hydration__nestedBar__barId": "nestedBar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBarId456", - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__nestedBar__barId: barId - name - } - } - variables: {"v0":["nestedBarId456"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "NestedBarName2", - "batch_hydration__nestedBar__barId": "nestedBarId456" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "bar": { - "name": "Bar 1", - "nestedBar": { - "name": "NestedBarName1", - "nestedBar": { - "name": "NestedBarName2" - } - } - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml deleted file mode 100644 index 95fb914a2..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations-and-synthetic-fields.yml +++ /dev/null @@ -1,275 +0,0 @@ -name: "query with three nested hydrations and synthetic fields" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - barsQuery: BarQuery - } - type BarQuery { - bar: Bar - barsById(id: [ID]): [Bar] - } - type Bar { - barId: ID - name: String - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barsQuery.barsById" - arguments: [{ name: "id" value: "$source.nestedBarId"}] - identifiedBy: "barId" - ) - } - Foo: | - type Query { - foos: [Foo] - } - type Foo { - name: String - bar: Bar - @hydrated( - service: "Bar" - field: "barsQuery.barsById" - arguments: [{ name: "id" value: "$source.barId"}] - identifiedBy: "barId" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - barId: ID - name: String - nestedBarId: ID - } - - type BarQuery { - bar: Bar - barsById(id: [ID]): [Bar] - } - - type Query { - barsQuery: BarQuery - } - Foo: | - type Foo { - barId: ID - name: String - } - - type Query { - foos: [Foo] - } -# language=GraphQL -query: | - query { - foos { - bar { - name - nestedBar { - name - nestedBar { - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foos { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar1" - }, - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar2" - }, - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar3" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsQuery { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__bar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - } - variables: {"v0":["bar3"]} - # language=JSON - response: |- - { - "data": { - "barsQuery": { - "barsById": [ - { - "name": "Bar 3", - "batch_hydration__bar__barId": "bar3", - "batch_hydration__nestedBar__nestedBarId": null, - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsQuery { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__bar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - } - variables: {"v0":["bar1","bar2"]} - # language=JSON - response: |- - { - "data": { - "barsQuery": { - "barsById": [ - { - "name": "Bar 1", - "batch_hydration__bar__barId": "bar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBar1", - "__typename__batch_hydration__nestedBar": "Bar" - }, - { - "name": "Bar 2", - "batch_hydration__bar__barId": "bar2", - "batch_hydration__nestedBar__nestedBarId": "nestedBar2", - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsQuery { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__nestedBar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - } - variables: {"v0":["nestedBar1","nestedBar2"]} - # language=JSON - response: |- - { - "data": { - "barsQuery": { - "barsById": [ - { - "name": "NestedBarName1", - "batch_hydration__nestedBar__barId": "nestedBar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBarId456", - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsQuery { - barsById(id: $v0) { - batch_hydration__nestedBar__barId: barId - name - } - } - } - variables: {"v0":["nestedBarId456"]} - # language=JSON - response: |- - { - "data": { - "barsQuery": { - "barsById": [ - { - "name": "NestedBarName2", - "batch_hydration__nestedBar__barId": "nestedBarId456" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "bar": { - "name": "Bar 1", - "nestedBar": { - "name": "NestedBarName1", - "nestedBar": { - "name": "NestedBarName2" - } - } - } - }, - { - "bar": { - "name": "Bar 2", - "nestedBar": null - } - }, - { - "bar": { - "name": "Bar 3", - "nestedBar": null - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml b/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml deleted file mode 100644 index c71a6d90a..000000000 --- a/test/src/test/resources/fixtures/new hydration/query-with-three-nested-hydrations.yml +++ /dev/null @@ -1,252 +0,0 @@ -name: "query with three nested hydrations" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - bar: Bar - barsById(id: [ID]): [Bar] - } - type Bar { - barId: ID - name: String - nestedBar: Bar - @hydrated( - service: "Bar" - field: "barsById" - arguments: [{name: "id" value: "$source.nestedBarId"}] - identifiedBy: "barId" - ) - } - Foo: | - type Query { - foos: [Foo] - } - type Foo { - name: String - bar: Bar - @hydrated( - service: "Bar" - field: "barsById" - arguments: [{name: "id" value: "$source.barId"}] - identifiedBy: "barId" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - barId: ID - name: String - nestedBarId: ID - } - - type Query { - bar: Bar - barsById(id: [ID]): [Bar] - } - Foo: | - type Foo { - barId: ID - name: String - } - - type Query { - foos: [Foo] - } -# language=GraphQL -query: | - query { - foos { - bar { - name - nestedBar { - name - nestedBar { - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foos { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar1" - }, - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar2" - }, - { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": "bar3" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__bar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["bar3"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "Bar 3", - "batch_hydration__bar__barId": "bar3", - "batch_hydration__nestedBar__nestedBarId": null, - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__bar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["bar1","bar2"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "Bar 1", - "batch_hydration__bar__barId": "bar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBar1", - "__typename__batch_hydration__nestedBar": "Bar" - }, - { - "name": "Bar 2", - "batch_hydration__bar__barId": "bar2", - "batch_hydration__nestedBar__nestedBarId": "nestedBar2", - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - __typename__batch_hydration__nestedBar: __typename - batch_hydration__nestedBar__barId: barId - name - batch_hydration__nestedBar__nestedBarId: nestedBarId - } - } - variables: {"v0":["nestedBar1","nestedBar2"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "NestedBarName1", - "batch_hydration__nestedBar__barId": "nestedBar1", - "batch_hydration__nestedBar__nestedBarId": "nestedBarId456", - "__typename__batch_hydration__nestedBar": "Bar" - } - ] - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsById(id: $v0) { - batch_hydration__nestedBar__barId: barId - name - } - } - variables: {"v0":["nestedBarId456"]} - # language=JSON - response: |- - { - "data": { - "barsById": [ - { - "name": "NestedBarName2", - "batch_hydration__nestedBar__barId": "nestedBarId456" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "bar": { - "name": "Bar 1", - "nestedBar": { - "name": "NestedBarName1", - "nestedBar": { - "name": "NestedBarName2" - } - } - } - }, - { - "bar": { - "name": "Bar 2", - "nestedBar": null - } - }, - { - "bar": { - "name": "Bar 3", - "nestedBar": null - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml b/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml deleted file mode 100644 index 8d0d505fa..000000000 --- a/test/src/test/resources/fixtures/new hydration/renamed-and-hydrated-query-using-same-underlying-source.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: "renamed and hydrated query using same underlying source" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - detail(detailId: ID): Detail - foo: Foo - } - type Foo { - renamedField: String @renamed(from: "issue.field") - details: [Detail] - @hydrated( - service: "Foo" - field: "detail" - arguments: [{name: "detailId" value: "$source.issue.fooId"}] - ) - } - type Detail { - detailId: ID! - name: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Detail { - detailId: ID! - name: String - } - - type Foo { - field: String - fooId: ID - issue: Issue - } - - type Issue { - field: String - fooId: ID - } - - type Query { - detail(detailId: ID): Detail - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - renamedField - details { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foo { - __typename__deep_rename__renamedField: __typename - __typename__hydration__details: __typename - deep_rename__renamedField__issue: issue { - field - } - hydration__details__issue: issue { - fooId - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__deep_rename__renamedField": "Foo", - "__typename__hydration__details": "Foo", - "hydration__details__issue": { - "fooId": "ID" - }, - "deep_rename__renamedField__issue": { - "field": "field" - } - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - detail(detailId: $v0) { - name - } - } - variables: {"v0":"ID"} - # language=JSON - response: |- - { - "data": { - "detail": { - "name": "apple" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "renamedField": "field", - "details": { - "name": "apple" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml deleted file mode 100644 index 802d61b8a..000000000 --- a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-overlapping-fields-in-the-query.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: "repeated hydrated fields on the same level. overlapping fields in the query" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foo: Foo - issue(issueId: ID): Issue - } - type Foo { - issue: Issue - @hydrated( - service: "Foo" - field: "issue" - arguments: [{name: "issueId" value: "$source.issueId"}] - ) - } - type Issue { - id: ID - name: String - desc: String - summary: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Foo { - issueId: ID - } - - type Issue { - desc: String - id: ID - name: String - summary: String - } - - type Query { - foo: Foo - issue(issueId: ID): Issue - } -# language=GraphQL -query: | - query { - foo { - issue { - name - summary - } - issue { - desc - summary - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__issue__issueId": "ISSUE-1", - "__typename__hydration__issue": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(issueId: $v0) { - desc - name - summary - } - } - variables: {"v0":"ISSUE-1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "name": "I AM A NAME", - "summary": "I AM A SUMMARY", - "desc": "I AM A DESC" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "issue": { - "name": "I AM A NAME", - "summary": "I AM A SUMMARY", - "desc": "I AM A DESC" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml deleted file mode 100644 index 50f1ece47..000000000 --- a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level-when-using-batch-hydration.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: "repeated hydrated fields on the same level when using batch hydration" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foo: Foo - issues(issueIds: [ID!]): [Issue!] - } - type Foo { - issue: Issue - @hydrated( - service: "Foo" - field: "issues" - arguments: [{name: "issueIds" value: "$source.issueId"}] - ) - } - type Issue { - id: ID - name: String - desc: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Foo { - issueId: ID - } - - type Issue { - desc: String - id: ID - name: String - } - - type Query { - foo: Foo - issues(issueIds: [ID!]): [Issue!] - } -# language=GraphQL -query: | - query { - foo { - issue { - name - } - issue { - desc - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "batch_hydration__issue__issueId": "ISSUE-1", - "__typename__batch_hydration__issue": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: [ID!]) { - issues(issueIds: $v0) { - desc - batch_hydration__issue__id: id - name - } - } - variables: {"v0":["ISSUE-1"]} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "name": "I AM A NAME", - "batch_hydration__issue__id": "ISSUE-1", - "desc": "I AM A DESC" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "issue": { - "name": "I AM A NAME", - "desc": "I AM A DESC" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml b/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml deleted file mode 100644 index 53e2ed0cb..000000000 --- a/test/src/test/resources/fixtures/new hydration/repeated-hydrated-fields-on-the-same-level.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: "repeated hydrated fields on the same level" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foo: Foo - issue(issueId: ID): Issue - } - type Foo { - issue: Issue - @hydrated( - service: "Foo" - field: "issue" - arguments: [{name: "issueId" value: "$source.issueId"}] - ) - } - type Issue { - id: ID - name: String - desc: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Foo { - issueId: ID - } - - type Issue { - desc: String - id: ID - name: String - } - - type Query { - foo: Foo - issue(issueId: ID): Issue - } -# language=GraphQL -query: | - query { - foo { - issue { - name - } - issue { - desc - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__issue__issueId": "ISSUE-1", - "__typename__hydration__issue": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(issueId: $v0) { - desc - name - } - } - variables: {"v0":"ISSUE-1"} - # language=JSON - response: |- - { - "data": { - "issue": { - "name": "I AM A NAME", - "desc": "I AM A DESC" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "issue": { - "name": "I AM A NAME", - "desc": "I AM A DESC" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml b/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml deleted file mode 100644 index 0e187a044..000000000 --- a/test/src/test/resources/fixtures/new hydration/same-source-for-2-hydrations.yml +++ /dev/null @@ -1,151 +0,0 @@ -name: "same source for 2 hydrations" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foo: Foo - detail(detailId: ID): Detail - issue(issueId: ID): Issue - } - type Foo { - issue: Issue - @hydrated( - service: "Foo" - field: "issue" - arguments: [{name: "issueId" value: "$source.fooId"}] - ) - detail: Detail - @hydrated( - service: "Foo" - field: "detail" - arguments: [{name: "detailId" value: "$source.fooId"}] - ) - } - type Detail { - detailId: ID! - name: String - } - type Issue { - fooId: ID - field: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Detail { - detailId: ID! - name: String - } - - type Foo { - field: String - fooId: ID - issue: Issue - } - - type Issue { - field: String - fooId: ID - } - - type Query { - detail(detailId: ID): Detail - foo: Foo - issue(issueId: ID): Issue - } -# language=GraphQL -query: | - query { - foo { - issue { - field - } - detail { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__issue: __typename - __typename__hydration__detail: __typename - hydration__issue__fooId: fooId - hydration__detail__fooId: fooId - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__detail__fooId": "ID", - "hydration__issue__fooId": "ID", - "__typename__hydration__issue": "Foo", - "__typename__hydration__detail": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(issueId: $v0) { - field - } - } - variables: {"v0":"ID"} - # language=JSON - response: |- - { - "data": { - "issue": { - "field": "field_name" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - detail(detailId: $v0) { - name - } - } - variables: {"v0":"ID"} - # language=JSON - response: |- - { - "data": { - "detail": { - "name": "apple" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "issue": { - "field": "field_name" - }, - "detail": { - "name": "apple" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml b/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml deleted file mode 100644 index 4a4cfbc06..000000000 --- a/test/src/test/resources/fixtures/new hydration/same-source-for-2-nested-hydrations-and-a-rename.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: "same source for 2 nested hydrations and a rename" -enabled: true -# language=GraphQL -overallSchema: - Foo: | - type Query { - foo: Foo - detail(detailId: ID): Detail - issue(issueId: ID): Issue - } - type Foo { - renamedField: String @renamed(from: "issue.field") - issue: Issue - @hydrated( - service: "Foo" - field: "issue" - arguments: [{name: "issueId" value: "$source.issue.fooId"}] - ) - detail: Detail - @hydrated( - service: "Foo" - field: "detail" - arguments: [{name: "detailId" value: "$source.issue.fooId"}] - ) - } - type Detail { - detailId: ID! - name: String - } - type Issue { - fooId: ID - field: String - } -# language=GraphQL -underlyingSchema: - Foo: | - type Detail { - detailId: ID! - name: String - } - - type Foo { - field: String - fooId: ID - issue: Issue - } - - type Issue { - field: String - fooId: ID - } - - type Query { - detail(detailId: ID): Detail - foo: Foo - issue(issueId: ID): Issue - } -# language=GraphQL -query: | - query { - foo { - issue { - field - } - detail { - name - } - renamedField - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query { - foo { - __typename__hydration__issue: __typename - __typename__hydration__detail: __typename - __typename__deep_rename__renamedField: __typename - hydration__issue__issue: issue { - fooId - } - hydration__detail__issue: issue { - fooId - } - deep_rename__renamedField__issue: issue { - field - } - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__deep_rename__renamedField": "Foo", - "hydration__issue__issue": { - "fooId": "ID" - }, - "hydration__detail__issue": { - "fooId": "ID" - }, - "__typename__hydration__issue": "Foo", - "__typename__hydration__detail": "Foo", - "deep_rename__renamedField__issue": { - "field": "field1" - } - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - issue(issueId: $v0) { - field - } - } - variables: {"v0":"ID"} - # language=JSON - response: |- - { - "data": { - "issue": { - "field": "field_name" - } - }, - "extensions": {} - } - - serviceName: "Foo" - request: - # language=GraphQL - query: | - query ($v0: ID) { - detail(detailId: $v0) { - name - } - } - variables: {"v0":"ID"} - # language=JSON - response: |- - { - "data": { - "detail": { - "name": "apple" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "issue": { - "field": "field_name" - }, - "detail": { - "name": "apple" - }, - "renamedField": "field1" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml b/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml deleted file mode 100644 index 943aff1d3..000000000 --- a/test/src/test/resources/fixtures/new hydration/simple-hydration-query-with-a-synthetic-field.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: "simple hydration query with a synthetic field" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - projects: ProjectsQuery - } - type ProjectsQuery { - project(id: ID): Project - } - type Project { - id: ID - name: String - } - service1: | - type Query { - issue(id: ID): Issue - } - type Issue { - id: ID - project: Project - @hydrated( - service: "service2" - field: "projects.project" - arguments: [{name: "id" value: "$source.projectId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Project { - id: ID - name: String - } - - type ProjectsQuery { - project(id: ID): Project - } - - type Query { - projects: ProjectsQuery - } - service1: | - type Issue { - id: ID - projectId: ID - } - - type Query { - issue(id: ID): Issue - } -# language=GraphQL -query: | - query { - issue { - project { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - issue { - __typename__hydration__project: __typename - hydration__project__projectId: projectId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__project__projectId": "project1", - "__typename__hydration__project": "Issue" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - projects { - project(id: $v0) { - name - } - } - } - variables: {"v0":"project1"} - # language=JSON - response: |- - { - "data": { - "projects": { - "project": { - "name": "Project 1" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "project": { - "name": "Project 1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml b/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml deleted file mode 100644 index ae956d11b..000000000 --- a/test/src/test/resources/fixtures/new hydration/simple-synthetic-hydration-with-one-service-and-type-renaming.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: "simple synthetic hydration with one service and type renaming" -enabled: true -# language=GraphQL -overallSchema: - testing: | - type Query { - tests: TestQuery - } - type TestQuery { - testing: Testing - character(id: ID): TestingCharacter - } - type Testing { - movie: Movie - } - type TestingCharacter @renamed(from: "Character") { - id: ID! - name: String - } - type Movie { - id: ID! - name: String - character: TestingCharacter - @hydrated( - service: "testing" - field: "tests.character" - arguments: [{name: "id" value: "$source.characterId"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - testing: | - type Character { - id: ID! - name: String - } - - type Movie { - characterId: ID - id: ID! - name: String - } - - type Query { - tests: TestQuery - } - - type TestQuery { - character(id: ID): Character - testing: Testing - } - - type Testing { - movie: Movie - } -# language=GraphQL -query: | - query { - tests { - testing { - movie { - id - name - character { - id - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "testing" - request: - # language=GraphQL - query: | - { - tests { - testing { - movie { - __typename__hydration__character: __typename - hydration__character__characterId: characterId - id - name - } - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "tests": { - "testing": { - "movie": { - "name": "Movie 1", - "__typename__hydration__character": "Movie", - "hydration__character__characterId": "C1", - "id": "M1" - } - } - } - }, - "extensions": {} - } - - serviceName: "testing" - request: - # language=GraphQL - query: | - query ($v0: ID) { - tests { - character(id: $v0) { - id - name - } - } - } - variables: {"v0":"C1"} - # language=JSON - response: |- - { - "data": { - "tests": { - "character": { - "name": "Luke", - "id": "C1" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "tests": { - "testing": { - "movie": { - "id": "M1", - "name": "Movie 1", - "character": { - "id": "C1", - "name": "Luke" - } - } - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml deleted file mode 100644 index 10761c43e..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-batching-returns-null.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: "synthetic hydration batching returns null" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsQuery: BarsQuery - } - type BarsQuery { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsQuery.barsById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type BarsQuery { - barsById(id: [ID]): [Bar] - } - - type Query { - barsQuery: BarsQuery - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsQuery { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "data": null, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": [ - null, - null, - null - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml deleted file mode 100644 index 6d7be7242..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-over-itself-within-renamed-types.yml +++ /dev/null @@ -1,211 +0,0 @@ -name: "synthetic hydration call over itself within renamed types" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - testing: | - type Query { - tests: TestQuery - } - type TestQuery { - testing: Testing - characters(ids: [ID!]!): [TestingCharacter] - } - type Testing { - movies: [TestingMovie] - } - type TestingCharacter @renamed(from: "Character") { - id: ID! - name: String - } - type TestingMovie @renamed(from: "Movie") { - id: ID! - name: String - characters: [TestingCharacter] - @hydrated( - service: "testing" - field: "tests.characters" - arguments: [{name: "ids" value: "$source.characterIds"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - testing: | - type Character { - id: ID! - name: String - } - - type Movie { - characterIds: [ID] - id: ID! - name: String - } - - type Query { - tests: TestQuery - } - - type TestQuery { - characters(ids: [ID!]!): [Character] - testing: Testing - } - - type Testing { - movies: [Movie] - } -# language=GraphQL -query: | - query { - tests { - testing { - movies { - id - name - characters { - id - name - } - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "testing" - request: - # language=GraphQL - query: | - { - tests { - testing { - movies { - __typename__batch_hydration__characters: __typename - batch_hydration__characters__characterIds: characterIds - id - name - } - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "tests": { - "testing": { - "movies": [ - { - "name": "Movie 1", - "id": "M1", - "batch_hydration__characters__characterIds": [ - "C1", - "C2" - ], - "__typename__batch_hydration__characters": "Movie" - }, - { - "name": "Movie 2", - "id": "M2", - "batch_hydration__characters__characterIds": [ - "C1", - "C2", - "C3" - ], - "__typename__batch_hydration__characters": "Movie" - } - ] - } - } - }, - "extensions": {} - } - - serviceName: "testing" - request: - # language=GraphQL - query: | - query ($v0: [ID!]!) { - tests { - characters(ids: $v0) { - id - batch_hydration__characters__id: id - name - } - } - } - variables: {"v0":["C1","C2","C3"]} - # language=JSON - response: |- - { - "data": { - "tests": { - "characters": [ - { - "name": "Luke", - "batch_hydration__characters__id": "C1", - "id": "C1" - }, - { - "name": "Leia", - "batch_hydration__characters__id": "C2", - "id": "C2" - }, - { - "name": "Anakin", - "batch_hydration__characters__id": "C3", - "id": "C3" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "tests": { - "testing": { - "movies": [ - { - "id": "M1", - "name": "Movie 1", - "characters": [ - { - "id": "C1", - "name": "Luke" - }, - { - "id": "C2", - "name": "Leia" - } - ] - }, - { - "id": "M2", - "name": "Movie 2", - "characters": [ - { - "id": "C1", - "name": "Luke" - }, - { - "id": "C2", - "name": "Leia" - }, - { - "id": "C3", - "name": "Anakin" - } - ] - } - ] - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml deleted file mode 100644 index 0cc4d5242..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-call-with-two-argument-values-from-original-field-arguments.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: "synthetic hydration call with two argument values from original field arguments" -enabled: true -# language=GraphQL -overallSchema: - UserService: | - type Query { - usersQuery: UsersQuery - } - type UsersQuery { - usersByIds(extraArg1: String, extraArg2: Int, id: [ID]): [User] - } - type User { - id: ID - name: String - } - Issues: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - author(extraArg1: String, extraArg2: Int): User @hydrated( - service: "UserService" - field: "usersQuery.usersByIds" - arguments: [ - {name: "extraArg1" value: "$argument.extraArg1"} - {name: "extraArg2" value: "$argument.extraArg2"} - {name: "id" value: "$source.authorId"} - ] - identifiedBy: "id" - batchSize: 2 - ) - } -# language=GraphQL -underlyingSchema: - UserService: | - type Query { - usersQuery: UsersQuery - } - - type User { - id: ID - name: String - } - - type UsersQuery { - usersByIds(extraArg1: String, extraArg2: Int, id: [ID]): [User] - } - Issues: | - type Issue { - authorId: ID - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - author(extraArg1: "extraArg1", extraArg2: 10) { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "Issues" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__author: __typename - batch_hydration__author__authorId: authorId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__author": "Issue", - "id": "ISSUE-1", - "batch_hydration__author__authorId": "USER-1" - } - ] - }, - "extensions": {} - } - - serviceName: "UserService" - request: - # language=GraphQL - query: | - query ($v0: String, $v1: Int, $v2: [ID]) { - usersQuery { - usersByIds(extraArg1: $v0, extraArg2: $v1, id: $v2) { - batch_hydration__author__id: id - name - } - } - } - variables: {"v0":"extraArg1","v1":10,"v2":["USER-1"]} - # language=JSON - response: |- - { - "data": { - "usersQuery": { - "usersByIds": [ - { - "name": "User 1", - "batch_hydration__author__id": "USER-1" - } - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "author": { - "name": "User 1" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml deleted file mode 100644 index bc1b303cb..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-forwards-error.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: "synthetic hydration forwards error" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsQuery: BarsQuery - } - type BarsQuery { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barsQuery.barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type BarsQuery { - barById(id: ID): Bar - } - - type Query { - barsQuery: BarsQuery - } - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId1", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barsQuery { - barById(id: $v0) { - name - } - } - } - variables: {"v0":"barId1"} - # language=JSON - response: |- - { - "errors": [ - { - "message": "Some error occurred" - } - ], - "data": null, - "extensions": {} - } -# language=JSON -response: |- - { - "errors": [ - { - "message": "Some error occurred", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ], - "data": { - "foo": { - "bar": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml deleted file mode 100644 index e04119d79..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-list-with-batching-forwards-error.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: "synthetic hydration list with batching forwards error" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barsQuery: BarsQuery - } - type BarsQuery { - barsById(id: [ID]): [Bar] - } - type Bar { - id: ID - name: String - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: [Bar] - @hydrated( - service: "service2" - field: "barsQuery.barsById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type BarsQuery { - barsById(id: [ID]): [Bar] - } - - type Query { - barsQuery: BarsQuery - } - service1: | - type Foo { - barId: [ID] - id: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__batch_hydration__bar: __typename - batch_hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__batch_hydration__bar": "Foo", - "batch_hydration__bar__barId": [ - "barId1", - "barId2", - "barId3" - ] - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - barsQuery { - barsById(id: $v0) { - batch_hydration__bar__id: id - name - } - } - } - variables: {"v0":["barId1","barId2","barId3"]} - # language=JSON - response: |- - { - "errors": [ - { - "message": "Some error occurred" - } - ], - "data": null, - "extensions": {} - } -# language=JSON -response: |- - { - "errors": [ - { - "message": "Some error occurred", - "locations": [], - "extensions": { - "classification": "DataFetchingException" - } - } - ], - "data": { - "foo": { - "bar": [ - null, - null, - null - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml deleted file mode 100644 index c96968c6d..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-with-renamed-type.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: "synthetic hydration with renamed type" -enabled: true -# language=GraphQL -overallSchema: - Bar: | - type Query { - bars: BarQuery - } - type BarQuery { - barById(id: ID!): Bar - } - type Bar { - id: ID! - } - Foo: | - type Query { - foo: Foo @renamed(from: "fooOriginal") - } - type Foo { - id: ID! - fooBar: Bar - @hydrated( - service: "Bar" - field: "bars.barById" - arguments: [{name: "id" value: "$source.fooBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - Bar: | - type Bar { - id: ID! - } - - type BarQuery { - barById(id: ID!): Bar - } - - type Query { - bars: BarQuery - } - Foo: | - type Foo { - fooBarId: ID - id: ID! - } - - type Query { - fooOriginal: Foo - } -# language=GraphQL -query: | - query { - foo { - id - fooBar { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "Foo" - request: - # language=GraphQL - query: | - { - rename__foo__fooOriginal: fooOriginal { - __typename__hydration__fooBar: __typename - hydration__fooBar__fooBarId: fooBarId - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "rename__foo__fooOriginal": { - "hydration__fooBar__fooBarId": "hydrated-bar", - "id": "Foo", - "__typename__hydration__fooBar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "Bar" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - bars { - barById(id: $v0) { - id - } - } - } - variables: {"v0":"hydrated-bar"} - # language=JSON - response: |- - { - "data": { - "bars": { - "barById": { - "id": "hydrated-bar" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "id": "Foo", - "fooBar": { - "id": "hydrated-bar" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml b/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml deleted file mode 100644 index fba1043fb..000000000 --- a/test/src/test/resources/fixtures/new hydration/synthetic-hydration-works-when-an-ancestor-field-has-been-renamed.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: "synthetic hydration works when an ancestor field has been renamed" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type DevOpsIssue @renamed(from: "Issue") { - id: ID - } - type DevOpsRelationship @renamed(from: "Relationship") { - devOpsIssue: DevOpsIssue - @hydrated( - service: "IssueService" - field: "syntheticIssue.issue" - arguments: [{name: "id" value: "$source.issueId"}] - ) - } - type DevOpsRelationshipConnection @renamed(from: "RelationshipConnection") { - devOpsNodes: [DevOpsRelationship] @renamed(from: "nodes") - } - type SyntheticIssue { - devOpsIssue(id: ID): DevOpsIssue @renamed(from: "issue") - issue(id: ID): DevOpsIssue - } - type Query { - devOpsRelationships: DevOpsRelationshipConnection @renamed(from: "relationships") - syntheticIssue: SyntheticIssue - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - } - - type Query { - relationships: RelationshipConnection - syntheticIssue: SyntheticIssue - } - - type Relationship { - issueId: ID - } - - type RelationshipConnection { - nodes: [Relationship] - } - - type SyntheticIssue { - issue(id: ID): Issue - } -# language=GraphQL -query: | - query { - devOpsRelationships { - devOpsNodes { - devOpsIssue { - id - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - { - rename__devOpsRelationships__relationships: relationships { - __typename__rename__devOpsNodes: __typename - rename__devOpsNodes__nodes: nodes { - __typename__hydration__devOpsIssue: __typename - hydration__devOpsIssue__issueId: issueId - } - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "rename__devOpsRelationships__relationships": { - "__typename__rename__devOpsNodes": "RelationshipConnection", - "rename__devOpsNodes__nodes": [ - { - "__typename__hydration__devOpsIssue": "Relationship", - "hydration__devOpsIssue__issueId": "1" - } - ] - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID) { - syntheticIssue { - issue(id: $v0) { - id - } - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "syntheticIssue": { - "issue": { - "id": "1" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "devOpsRelationships": { - "devOpsNodes": [ - { - "devOpsIssue": { - "id": "1" - } - } - ] - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml deleted file mode 100644 index a117e4c2a..000000000 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-batched-synthetic-hydration.yml +++ /dev/null @@ -1,191 +0,0 @@ -name: "top level field data returns null in batched synthetic hydration" -enabled: true -# language=GraphQL -overallSchema: - # language=GraphQL - service2: | - type Query { - users: UsersQuery - } - type UsersQuery { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - name: String - } - # language=GraphQL - service1: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "service2" - field: "users.usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - # language=GraphQL - service2: | - type Query { - users: UsersQuery - } - - type User { - id: ID - name: String - } - - type UsersQuery { - usersByIds(id: [ID]): [User] - } - # language=GraphQL - service1: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "users": { - "usersByIds": null - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "users": { - "usersByIds": null - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - null, - null - ] - }, - { - "id": "ISSUE-2", - "authors": [ - null - ] - }, - { - "id": "ISSUE-3", - "authors": [ - null, - null, - null - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml deleted file mode 100644 index 51f1899f4..000000000 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-data-returns-null-in-synthetic-hydration.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: "top level field data returns null in synthetic hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - projects: ProjectsQuery - } - type ProjectsQuery { - project(id: ID): Project - } - type Project { - id: ID - name: String - } - service1: | - type Query { - issue(id: ID): Issue - } - type Issue { - id: ID - project: Project - @hydrated( - service: "service2" - field: "projects.project" - arguments: [{name: "id" value: "$source.projectId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Project { - id: ID - name: String - } - - type ProjectsQuery { - project(id: ID): Project - } - - type Query { - projects: ProjectsQuery - } - service1: | - type Issue { - id: ID - projectId: ID - } - - type Query { - issue(id: ID): Issue - } -# language=GraphQL -query: | - query { - issue { - project { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - issue { - __typename__hydration__project: __typename - hydration__project__projectId: projectId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__project__projectId": "project1", - "__typename__hydration__project": "Issue" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - projects { - project(id: $v0) { - name - } - } - } - variables: {"v0":"project1"} - # language=JSON - response: |- - { - "data": { - "projects": { - "project": null - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "project": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml deleted file mode 100644 index 65b632eef..000000000 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-batched-synthetic-hydration.yml +++ /dev/null @@ -1,182 +0,0 @@ -name: "top level field is null in batched synthetic hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - users: UsersQuery - } - type UsersQuery { - usersByIds(id: [ID]): [User] - } - type User { - id: ID - } - service1: | - type Query { - issues: [Issue] - } - type Issue { - id: ID - authors: [User] - @hydrated( - service: "service2" - field: "users.usersByIds" - arguments: [{name: "id" value: "$source.authorIds"}] - identifiedBy: "id" - batchSize: 3 - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Query { - users: UsersQuery - } - - type User { - id: ID - name: String - } - - type UsersQuery { - usersByIds(id: [ID]): [User] - } - service1: | - type Issue { - authorIds: [ID] - id: ID - } - - type Query { - issues: [Issue] - } -# language=GraphQL -query: | - query { - issues { - id - authors { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - issues { - __typename__batch_hydration__authors: __typename - batch_hydration__authors__authorIds: authorIds - id - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issues": [ - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-1", - "USER-2" - ], - "id": "ISSUE-1" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-3" - ], - "id": "ISSUE-2" - }, - { - "__typename__batch_hydration__authors": "Issue", - "batch_hydration__authors__authorIds": [ - "USER-2", - "USER-4", - "USER-5" - ], - "id": "ISSUE-3" - } - ] - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-1","USER-2","USER-3"]} - # language=JSON - response: |- - { - "data": { - "users": null - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - users { - usersByIds(id: $v0) { - id - batch_hydration__authors__id: id - } - } - } - variables: {"v0":["USER-4","USER-5"]} - # language=JSON - response: |- - { - "data": { - "users": null - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issues": [ - { - "id": "ISSUE-1", - "authors": [ - null, - null - ] - }, - { - "id": "ISSUE-2", - "authors": [ - null - ] - }, - { - "id": "ISSUE-3", - "authors": [ - null, - null, - null - ] - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml b/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml deleted file mode 100644 index 173fe072a..000000000 --- a/test/src/test/resources/fixtures/new hydration/top-level-field-is-null-in-synthetic-hydration.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: "top level field is null in synthetic hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - projects: ProjectsQuery - } - type ProjectsQuery { - project(id: ID): Project - } - type Project { - id: ID - name: String - } - service1: | - type Query { - issue(id: ID): Issue - } - type Issue { - id: ID - project: Project - @hydrated( - service: "service2" - field: "projects.project" - arguments: [{name: "id" value: "$source.projectId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Project { - id: ID - name: String - } - - type ProjectsQuery { - project(id: ID): Project - } - - type Query { - projects: ProjectsQuery - } - service1: | - type Issue { - id: ID - projectId: ID - } - - type Query { - issue(id: ID): Issue - } -# language=GraphQL -query: | - query { - issue { - project { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - issue { - __typename__hydration__project: __typename - hydration__project__projectId: projectId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "issue": { - "hydration__project__projectId": "project1", - "__typename__hydration__project": "Issue" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - projects { - project(id: $v0) { - name - } - } - } - variables: {"v0":"project1"} - # language=JSON - response: |- - { - "data": { - "projects": { - "project": null - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issue": { - "project": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml b/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml deleted file mode 100644 index cfa267c57..000000000 --- a/test/src/test/resources/fixtures/new hydration/transformer-on-hydration-fields.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: "transformer on hydration fields" -enabled: true -# language=GraphQL -overallSchema: - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - } - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - name: String - } -# language=GraphQL -underlyingSchema: - service1: | - type Foo { - barId: ID - id: ID - } - - type Query { - foo: Foo - } - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } -# language=GraphQL -query: | - query { - foo { - bar { - name - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - name - } - } - variables: {"v0":"transformed-id"} - # language=JSON - response: |- - { - "data": { - "barById": { - "name": "Bar1" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "name": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/oneOf/one-of-successful.yml b/test/src/test/resources/fixtures/oneOf/one-of-successful.yml deleted file mode 100644 index c62de58b8..000000000 --- a/test/src/test/resources/fixtures/oneOf/one-of-successful.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "oneOf successful" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - search(by: SearchInput): String - } - input SearchInput @oneOf { - name: String - id: ID - } -# language=GraphQL -underlyingSchema: - MyService: |- - type Query { - search(by: SearchInput): String - } - input SearchInput @oneOf { - name: String - id: ID - } -# language=GraphQL -query: | - query myQuery { - search(by: {name: "Figaro"}) - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query myQuery($v0: SearchInput) { - search(by: $v0) - } - variables: {"v0":{"name":"Figaro"}} - operationName: "myQuery" - # language=JSON - response: |- - { - "data": { - "search": "Figaro" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "search": "Figaro" - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml b/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml deleted file mode 100644 index 68dc5ca60..000000000 --- a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-get-typename-added.yml +++ /dev/null @@ -1,204 +0,0 @@ -name: "lower level interface fields get typename added" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - collar { - color - } - } - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - collar { - color - } - name - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "collar": { - "color": "blue" - } - }, - { - "name": "Whiskers", - "collar": { - "color": "red" - } - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "collar": { - "color": "blue" - } - }, - { - "name": "Whiskers", - "collar": { - "color": "red" - } - } - ] - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 10, - "serviceNodeCounts": { - "PetService": 10 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml b/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml deleted file mode 100644 index 1aaa31aa7..000000000 --- a/test/src/test/resources/fixtures/polymorphism/lower-level-interface-fields-which-are-renamed-get-typename-added.yml +++ /dev/null @@ -1,214 +0,0 @@ -name: "lower level interface fields which are renamed get typename added" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - collarToRenamed { - color - } - } - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - __typename__rename__collarToRenamed: __typename - name - ... on Cat { - rename__collarToRenamed__collar: collar { - color - } - } - ... on Dog { - rename__collarToRenamed__collar: collar { - color - } - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "rename__collarToRenamed__collar": { - "color": "blue" - }, - "__typename__rename__collarToRenamed": "Dog" - }, - { - "name": "Whiskers", - "rename__collarToRenamed__collar": { - "color": "red" - }, - "__typename__rename__collarToRenamed": "Cat" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "collarToRenamed": { - "color": "blue" - } - }, - { - "name": "Whiskers", - "collarToRenamed": { - "color": "red" - } - } - ] - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 8, - "serviceNodeCounts": { - "PetService": 8 - }, - "fieldRenamesCount": 2, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml deleted file mode 100644 index 1f1bc8a78..000000000 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-dont-have-typename-in-them-work-as-expected.yml +++ /dev/null @@ -1,239 +0,0 @@ -name: "query with pass through interfaces and unions that DONT have __typename in them work as expected" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - ... on Dog { - wearsCollar - } - ... on Cat { - wearsBell - } - } - raining(isLoyal: $isLoyal) { - ... on Dog { - wearsCollar - } - ... on Cat { - wearsBell - } - } - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - raining(isLoyal: $v0) { - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "raining": { - "wearsCollar": true - } - }, - "extensions": {} - } - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - name - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true - }, - { - "name": "Whiskers", - "wearsBell": false - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true - }, - { - "name": "Whiskers", - "wearsBell": false - } - ], - "raining": { - "wearsCollar": true - } - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 11, - "serviceNodeCounts": { - "PetService": 11 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml deleted file mode 100644 index 3cf3742bf..000000000 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-aliased-typename-in-fragments-work-as-expected.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: "query with pass through interfaces and unions that have aliased __typename in fragments work as expected" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - ...DogFrag - ... on Cat { - wearsBell - aliasedCatTypeName: __typename - } - } - } - - fragment DogFrag on Dog { - wearsCollar - aliasedDogTypeName: __typename - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - name - ... on Cat { - aliasedCatTypeName: __typename - wearsBell - } - ... on Dog { - aliasedDogTypeName: __typename - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "aliasedDogTypeName": "Dog" - }, - { - "name": "Whiskers", - "wearsBell": false, - "aliasedCatTypeName": "Cat" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "aliasedDogTypeName": "Dog" - }, - { - "name": "Whiskers", - "wearsBell": false, - "aliasedCatTypeName": "Cat" - } - ] - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 10, - "serviceNodeCounts": { - "PetService": 10 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml deleted file mode 100644 index 17ba9c97c..000000000 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-mixed-typename-in-them-work-as-expected.yml +++ /dev/null @@ -1,247 +0,0 @@ -name: "query with pass through interfaces and unions that have MIXED __typename in them work as expected" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - ... on Dog { - wearsCollar - __typename - } - ... on Cat { - wearsBell - } - } - raining(isLoyal: $isLoyal) { - __typename - ... on Dog { - wearsCollar - } - ... on Cat { - wearsBell - } - } - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - name - ... on Cat { - wearsBell - } - ... on Dog { - __typename - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "__typename": "Dog" - }, - { - "name": "Whiskers", - "wearsBell": false - } - ] - }, - "extensions": {} - } - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - raining(isLoyal: $v0) { - __typename - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "raining": { - "wearsCollar": true, - "__typename": "Dog" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "__typename": "Dog" - }, - { - "name": "Whiskers", - "wearsBell": false - } - ], - "raining": { - "__typename": "Dog", - "wearsCollar": true - } - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 13, - "serviceNodeCounts": { - "PetService": 13 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml deleted file mode 100644 index 2e62c3561..000000000 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-fragments-work-as-expected.yml +++ /dev/null @@ -1,257 +0,0 @@ -name: "query with pass through interfaces and unions that have __typename in fragments work as expected" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - ...DogFrag - ... on Dog { - wearsCollar - __typename - } - ... on Cat { - wearsBell - __typename - } - } - raining(isLoyal: $isLoyal) { - ... on Dog { - wearsCollar - __typename - } - ... on Cat { - wearsBell - __typename - } - } - } - - fragment DogFrag on Dog { - wearsCollar - __typename - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - __typename - name - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "__typename": "Dog" - }, - { - "name": "Whiskers", - "wearsBell": false, - "__typename": "Cat" - } - ] - }, - "extensions": {} - } - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - raining(isLoyal: $v0) { - __typename - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "raining": { - "wearsCollar": true, - "__typename": "Dog" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "__typename": "Dog" - }, - { - "name": "Whiskers", - "__typename": "Cat", - "wearsBell": false - } - ], - "raining": { - "wearsCollar": true, - "__typename": "Dog" - } - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 14, - "serviceNodeCounts": { - "PetService": 14 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml b/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml deleted file mode 100644 index 2f1534932..000000000 --- a/test/src/test/resources/fixtures/polymorphism/query-with-pass-through-interfaces-and-unions-that-have-typename-in-them-work-as-expected.yml +++ /dev/null @@ -1,250 +0,0 @@ -name: "query with pass through interfaces and unions that have __typename in them work as expected" -enabled: true -# language=GraphQL -overallSchema: - PetService: | - type Query { - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - interface Pet { - name: String - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Cat implements Pet { - name: String - wearsBell: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - type Dog implements Pet { - name: String - wearsCollar: Boolean - collar: Collar - collarToRenamed: Collar @renamed(from: "collar") - } - union CatsAndDogs = Cat | Dog - interface Collar { - color: String - size: String - } - type DogCollar implements Collar { - color: String - size: String - } - type CatCollar implements Collar { - color: String - size: String - } - OwnerService: | - type Query { - owner(id: String): Owner - } - interface Owner { - name: String - } - type CaringOwner implements Owner { - name: String - givesPats: Boolean - } - type CruelOwner implements Owner { - name: String - givesSmacks: Boolean - } -# language=GraphQL -underlyingSchema: - PetService: | - interface Collar { - color: String - size: String - } - - interface Pet { - collar: Collar - name: String - ownerIds: [String] - } - - union CatsAndDogs = Cat | Dog - - type Cat implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsBell: Boolean - } - - type CatCollar implements Collar { - color: String - size: String - } - - type Dog implements Pet { - collar: Collar - name: String - ownerIds: [String] - wearsCollar: Boolean - } - - type DogCollar implements Collar { - color: String - size: String - } - - type Mutation { - hello: String - } - - type Query { - hello: World - pets(isLoyal: Boolean): [Pet] - raining(isLoyal: Boolean): CatsAndDogs - } - - type World { - id: ID - name: String - } - OwnerService: | - interface Owner { - name: String - } - - type CaringOwner implements Owner { - givesPats: Boolean - name: String - } - - type CruelOwner implements Owner { - givesSmacks: Boolean - name: String - } - - type Query { - owner(id: String): Owner - } -# language=GraphQL -query: | - query petQ($isLoyal: Boolean) { - pets(isLoyal: $isLoyal) { - name - __typename - ... on Dog { - wearsCollar - __typename - } - ... on Cat { - wearsBell - } - } - raining(isLoyal: $isLoyal) { - __typename - ... on Dog { - wearsCollar - } - ... on Cat { - wearsBell - } - } - } -variables: - isLoyal: true -serviceCalls: - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - raining(isLoyal: $v0) { - __typename - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "raining": { - "wearsCollar": true, - "__typename": "Dog" - } - }, - "extensions": {} - } - - serviceName: "PetService" - request: - # language=GraphQL - query: | - query petQ($v0: Boolean) { - pets(isLoyal: $v0) { - __typename - name - ... on Cat { - wearsBell - } - ... on Dog { - wearsCollar - } - } - } - variables: {"v0":true} - operationName: "petQ" - # language=JSON - response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "wearsCollar": true, - "__typename": "Dog" - }, - { - "name": "Whiskers", - "wearsBell": false, - "__typename": "Cat" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "pets": [ - { - "name": "Sparky", - "__typename": "Dog", - "wearsCollar": true - }, - { - "name": "Whiskers", - "__typename": "Cat", - "wearsBell": false - } - ], - "raining": { - "__typename": "Dog", - "wearsCollar": true - } - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 14, - "serviceNodeCounts": { - "PetService": 14 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml b/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml deleted file mode 100644 index 5c26b62e1..000000000 --- a/test/src/test/resources/fixtures/renames/chain-rename-transform-with-type-rename.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: "chain rename transform with type rename" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - test(arg: String): Test @renamed(from: "world") - } - type Test @renamed(from: "World") { - id: ID - cities(continent: Continent): [String] @renamed(from: "places") - } - enum Continent { - Africa - Antarctica - Asia - Oceania - Europe - NorthAmerica - SouthAmerica - } -# language=GraphQL -underlyingSchema: - MyService: | - type Query { - world(arg: String): World - } - type World { - id: ID - places(continent: Continent): [String] - } - enum Continent { - Africa - Antarctica - Asia - Oceania - Europe - NorthAmerica - SouthAmerica - } -# So the hook associated with this test will change the arg values -query: | - query { - test(arg: "Hello World") { - __typename - id - cities(continent: Oceania) - } - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query ($v0: Continent, $v1: String) { - rename__test__world: world(arg: $v1) { - __typename - __typename__rename__cities: __typename - id - rename__cities__places: places(continent: $v0) - } - } - variables: {"v0":"Asia","v1":"aaarrg"} - # language=JSON - response: |- - { - "data": { - "rename__test__world": { - "__typename": "World", - "__typename__rename__cities": "World", - "id": "Earth", - "rename__cities__places": [ - "Uhh yea I know cities"] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "test": { - "__typename": "Test", - "id": "Earth", - "cities": [ - "Uhh yea I know cities" - ] - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/renames/chain-rename-transform.yml b/test/src/test/resources/fixtures/renames/chain-rename-transform.yml deleted file mode 100644 index 30f57d4ac..000000000 --- a/test/src/test/resources/fixtures/renames/chain-rename-transform.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "chain rename transform" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - test(arg: String): World @renamed(from: "world") - } - type World { - id: ID - cities(continent: Continent): [String] @renamed(from: "places") - } - enum Continent { - Africa - Antarctica - Asia - Oceania - Europe - NorthAmerica - SouthAmerica - } -# language=GraphQL -underlyingSchema: - MyService: | - type Query { - world(arg: String): World - } - type World { - id: ID - places(continent: Continent): [String] - } - enum Continent { - Africa - Antarctica - Asia - Oceania - Europe - NorthAmerica - SouthAmerica - } -# So the hook associated with this test will change the arg values -query: | - query { - test(arg: "Hello World") { - __typename - id - cities(continent: Oceania) - } - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query ($v0: Continent, $v1: String) { - rename__test__world: world(arg: $v1) { - __typename - __typename__rename__cities: __typename - id - rename__cities__places: places(continent: $v0) - } - } - variables: {"v0":"Asia","v1":"aaarrg"} - # language=JSON - response: |- - { - "data": { - "rename__test__world": { - "__typename": "World", - "__typename__rename__cities": "World", - "id": "Earth", - "rename__cities__places": [ - "Uhh yea I know cities" - ] - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "test": { - "__typename": "World", - "id": "Earth", - "cities": [ - "Uhh yea I know cities" - ] - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml b/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml deleted file mode 100644 index 77e50ed7b..000000000 --- a/test/src/test/resources/fixtures/renames/rename-inside-hydration.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: "rename inside hydration" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - title: String @renamed(from: "name") - } - service1: | - type Query { - foo: Foo - } - type Foo { - id: ID - bar: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.barId"} - ] - ) - barLongerInput: Bar @hydrated( - service: "service2" - field: "barById" - arguments: [ - {name: "id" value: "$source.fooDetails.externalBarId"} - ] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foo: Foo - } -# language=GraphQL -query: | - query { - foo { - bar { - title - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - __typename__rename__title: __typename - rename__title__name: name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "rename__title__name": "Bar1", - "__typename__rename__title": "Bar" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "bar": { - "title": "Bar1" - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml b/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml deleted file mode 100644 index 33e4a0258..000000000 --- a/test/src/test/resources/fixtures/renames/rename-inside-multiple-hydrations.yml +++ /dev/null @@ -1,158 +0,0 @@ -name: "rename inside multiple hydrations" -enabled: true -# language=GraphQL -overallSchema: - service2: | - type Query { - barById(id: ID): Bar - } - type Bar { - id: ID - title: String @renamed(from: "name") - } - service1: | - type Query { - foos: [Foo] - } - type Foo { - id: ID - bar: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.barId"}] - ) - barLongerInput: Bar - @hydrated( - service: "service2" - field: "barById" - arguments: [{name: "id" value: "$source.fooDetails.externalBarId"}] - ) - } -# language=GraphQL -underlyingSchema: - service2: | - type Bar { - id: ID - name: String - } - - type Query { - barById(id: ID): Bar - } - service1: | - type Foo { - barId: ID - fooDetails: FooDetails - id: ID - } - - type FooDetails { - externalBarId: ID - } - - type Query { - foos: [Foo] - } -# language=GraphQL -query: | - query { - foos { - bar { - title - } - } - } -variables: { } -serviceCalls: - - serviceName: "service1" - request: - # language=GraphQL - query: | - { - foos { - __typename__hydration__bar: __typename - hydration__bar__barId: barId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "hydration__bar__barId": "barId", - "__typename__hydration__bar": "Foo" - }, - { - "hydration__bar__barId": "barId2", - "__typename__hydration__bar": "Foo" - } - ] - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - __typename__rename__title: __typename - rename__title__name: name - } - } - variables: {"v0":"barId"} - # language=JSON - response: |- - { - "data": { - "barById": { - "rename__title__name": "Bar1", - "__typename__rename__title": "Bar" - } - }, - "extensions": {} - } - - serviceName: "service2" - request: - # language=GraphQL - query: | - query ($v0: ID) { - barById(id: $v0) { - __typename__rename__title: __typename - rename__title__name: name - } - } - variables: {"v0":"barId2"} - # language=JSON - response: |- - { - "data": { - "barById": { - "rename__title__name": "Bar2", - "__typename__rename__title": "Bar" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "bar": { - "title": "Bar1" - } - }, - { - "bar": { - "title": "Bar2" - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml b/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml deleted file mode 100644 index 901252dc1..000000000 --- a/test/src/test/resources/fixtures/renames/rename-on-shared-abstract-type.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: "rename on shared abstract type" -enabled: true -# language=GraphQL -overallSchema: - shared: | - interface Node { - id: ID! - } - worlds: | - type Query { - node(id: ID): Node - } - type World implements Node { - id: ID! - } - planets: | - type Planet implements Node { - id: ID! @renamed(from: "identifier") - } -# language=GraphQL -underlyingSchema: - planets: | - type Query { - echo: String - } - type Planet implements Node { - identifier: ID! - id: ID! - } - interface Node { - id: ID! - } - worlds: | - type Query { - node(id: ID): Node - worlds: [World] - } - type World implements Node { - id: ID! - } - interface Node { - id: ID! - } - shared: | - type Query { - echo: String - } -# Bug is that normally the rename transform will transform based on the -# possible instructions. This field will go to the worlds service but the -# rename transform may insert ... on Planet { rename_id: identifier } as it -# sees it as a possibility if it hasn't worked on the new filtered types -query: | - query { - node(id: "world-1") { - id - } - } -variables: { } -serviceCalls: - - serviceName: "worlds" - request: - # language=GraphQL - query: | - query ($v0: ID) { - node(id: $v0) { - id - } - } - variables: {"v0":"world-1"} - # language=JSON - response: |- - { - "data": { - "node": { - "id": "Test" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "node": { - "id": "Test" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml b/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml deleted file mode 100644 index da5c4b961..000000000 --- a/test/src/test/resources/fixtures/renames/renamed-top-level-field-with-argument.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "renamed top level field with argument" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - renameObject(id: ID!): ObjectOverall @renamed(from: "renameObjectUnderlying") - } - type ObjectOverall @renamed(from: "ObjectUnderlying") { - name: String - } -# language=GraphQL -underlyingSchema: - MyService: | - type ObjectUnderlying { - name: String - } - - type Query { - renameObjectUnderlying(id: ID!): ObjectUnderlying - } -# language=GraphQL -query: | - query { - renameObject(id: "OBJECT-001") { - name - } - } -variables: { } -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - rename__renameObject__renameObjectUnderlying: renameObjectUnderlying(id: $v0) { - name - } - } - variables: {"v0":"OBJECT-001"} - # language=JSON - response: |- - { - "data": { - "rename__renameObject__renameObjectUnderlying": { - "name": "Object 001" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "renameObject": { - "name": "Object 001" - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml deleted file mode 100644 index 5278b8129..000000000 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-batch-hydration.yml +++ /dev/null @@ -1,175 +0,0 @@ -name: "renamed type inside batch hydration" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issuesByIds(id: [ID!]): [Issue] - } - type Issue { - details: IssueDetails - } - type IssueDetails @renamed(from: "Details") { - name: String - } - UserService: | - type Query { - users: [User] - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issuesByIds" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - identifiedBy: "id" - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - details: Details - } - - type Details { - name: String - } - - type Query { - issuesByIds(id: [ID!]): [Issue] - } - UserService: | - type Query { - users: [User] - } - - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - users { - issue { - details { - __typename - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - users { - __typename__batch_hydration__issue: __typename - batch_hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "users": [ - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-1" - }, - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-2" - }, - { - "__typename__batch_hydration__issue": "User", - "batch_hydration__issue__issueId": "issue-3" - } - ] - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: [ID!]) { - issuesByIds(id: $v0) { - details { - __typename - name - } - batch_hydration__issue__id: id - } - } - variables: {"v0":["issue-1","issue-2","issue-3"]} - # language=JSON - response: |- - { - "data": { - "issuesByIds": [ - { - "batch_hydration__issue__id": "issue-1", - "details": { - "__typename": "Details", - "name": "Details of issue one" - } - }, - { - "batch_hydration__issue__id": "issue-2", - "details": { - "__typename": "Details", - "name": "Issue two" - } - }, - { - "batch_hydration__issue__id": "issue-3", - "details": { - "__typename": "Details", - "name": "Issue four – no wait three" - } - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "users": [ - { - "issue": { - "details": { - "__typename": "IssueDetails", - "name": "Details of issue one" - } - } - }, - { - "issue": { - "details": { - "__typename": "IssueDetails", - "name": "Issue two" - } - } - }, - { - "issue": { - "details": { - "__typename": "IssueDetails", - "name": "Issue four – no wait three" - } - } - } - ] - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml deleted file mode 100644 index 7087183b2..000000000 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename-that-returns-null.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "renamed type inside deep rename that returns null" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID!): Issue - } - type Issue { - assignee: IssueUser @renamed(from: "details.assignee") - } - type IssueUser @renamed(from: "User") { - name: String - friends: [IssueUser] - } - type IssueDetails @renamed(from: "Details") { - name: String - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - details: Details - } - type Details { - name: String - assignee: User - } - type User { - name: String - friends: [User] - } - type Query { - issueById(id: ID!): Issue - } -# language=GraphQL -query: | - query { - issueById(id: "issue-1") { - assignee { - name - __typename - friends { - __typename - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__deep_rename__assignee: __typename - deep_rename__assignee__details: details { - assignee { - __typename - friends { - __typename - } - name - } - } - } - } - variables: {"v0":"issue-1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "__typename__deep_rename__assignee": "Issue", - "deep_rename__assignee__details": { - "assignee": null - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issueById": { - "assignee": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml deleted file mode 100644 index 1a7291adf..000000000 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-deep-rename.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: "renamed type inside deep rename" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID!): Issue - } - type Issue { - assignee: IssueUser @renamed(from: "details.assignee") - } - type IssueUser @renamed(from: "User") { - name: String - friends: [IssueUser] - } - type IssueDetails @renamed(from: "Details") { - name: String - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - details: Details - } - type Details { - name: String - assignee: User - } - type User { - name: String - friends: [User] - } - type Query { - issueById(id: ID!): Issue - } -# language=GraphQL -query: | - query { - issueById(id: "issue-1") { - assignee { - name - __typename - friends { - __typename - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - __typename__deep_rename__assignee: __typename - deep_rename__assignee__details: details { - assignee { - __typename - friends { - __typename - } - name - } - } - } - } - variables: {"v0":"issue-1"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "__typename__deep_rename__assignee": "Issue", - "deep_rename__assignee__details": { - "assignee": { - "__typename": "User", - "friends": [ - { - "__typename": "User" - }, - { - "__typename": "User" - } - ], - "name": "Franklin" - } - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "issueById": { - "assignee": { - "__typename": "IssueUser", - "name": "Franklin", - "friends": [ - { - "__typename": "IssueUser" - }, - { - "__typename": "IssueUser" - } - ] - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml deleted file mode 100644 index f8d17aca6..000000000 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration-that-returns-null.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: "renamed type inside hydration that returns null" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID!): Issue - } - type Issue { - details: IssueDetails - } - type IssueDetails @renamed(from: "Details") { - name: String - } - UserService: | - type Query { - me: User - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issueById" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - details: Details - } - - type Details { - name: String - } - - type Query { - issueById(id: ID!): Issue - } - UserService: | - type Query { - me: User - } - - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - me { - issue { - details { - __typename - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - me { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "me": { - "__typename__hydration__issue": "User", - "hydration__issue__issueId": "issue-2" - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - details { - __typename - name - } - } - } - variables: {"v0":"issue-2"} - # language=JSON - response: |- - { - "data": { - "issueById": null, - "extensions": {} - } - } -# language=JSON -response: |- - { - "data": { - "me": { - "issue": null - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml b/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml deleted file mode 100644 index 9d699a4c3..000000000 --- a/test/src/test/resources/fixtures/renames/types/renamed-type-inside-hydration.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: "renamed type inside hydration" -enabled: true -# language=GraphQL -overallSchema: - IssueService: | - type Query { - issueById(id: ID!): Issue - } - type Issue { - details: IssueDetails - } - type IssueDetails @renamed(from: "Details") { - name: String - } - UserService: | - type Query { - me: User - } - type User { - issueId: ID - issue: Issue @hydrated( - service: "IssueService" - field: "issueById" - arguments: [ - {name: "id" value: "$source.issueId"} - ] - ) - } -# language=GraphQL -underlyingSchema: - IssueService: | - type Issue { - id: ID - details: Details - } - - type Details { - name: String - } - - type Query { - issueById(id: ID!): Issue - } - UserService: | - type Query { - me: User - } - - type User { - issueId: ID - } -# language=GraphQL -query: | - query { - me { - issue { - details { - __typename - name - } - } - } - } -variables: { } -serviceCalls: - - serviceName: "UserService" - request: - # language=GraphQL - query: | - { - me { - __typename__hydration__issue: __typename - hydration__issue__issueId: issueId - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "me": { - "__typename__hydration__issue": "User", - "hydration__issue__issueId": "issue-2" - } - }, - "extensions": {} - } - - serviceName: "IssueService" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - issueById(id: $v0) { - details { - __typename - name - } - } - } - variables: {"v0":"issue-2"} - # language=JSON - response: |- - { - "data": { - "issueById": { - "details": { - "__typename": "Details", - "name": "Issue two" - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "me": { - "issue": { - "details": { - "__typename": "IssueDetails", - "name": "Issue two" - } - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml b/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml deleted file mode 100644 index a5f4e61a8..000000000 --- a/test/src/test/resources/fixtures/renames/types/repeated-fragments-with-renamed-types.yml +++ /dev/null @@ -1,390 +0,0 @@ -name: "repeated fragments with renamed types" -enabled: true -# language=GraphQL -overallSchema: - Users: | - type Query { - service(id: ID!): MyService - } - - type MyService @renamed(from: "Service") { - id: ID! - name: String - dependedOn: ServiceRelationshipConnection - dependsOn: ServiceRelationshipConnection - } - - type ServiceRelationshipConnection @renamed(from: "RelationshipConnection") { - nodes: [ServiceRelationship] - } - - type ServiceRelationship implements Node @renamed(from: "Relationship") { - id: ID! - type: String - startService: MyService - endService: MyService - } - - interface Node { - id: ID! - } -# language=GraphQL -underlyingSchema: - Users: | - type Query { - service(id: ID!): Service - } - - type Service { - id: ID! - name: String - dependedOn: RelationshipConnection - dependsOn: RelationshipConnection - } - - type RelationshipConnection { - nodes: [Relationship] - } - - type Relationship implements Node { - id: ID! - type: String - startService: Service - endService: Service - } - - interface Node { - id: ID! - } -# language=GraphQL -query: | - query($var1: ID!) { - service(id: $var1) { - __typename - dependedOn { - __typename - ...ServiceRelationshipsWithGrandchildren - } - dependsOn { - __typename - ...ServiceRelationshipsWithGrandchildren - } - ...BaseServiceInfo - } - } - - fragment BaseServiceInfo on MyService { - __typename - id - name - } - - fragment BaseServiceRelationships on ServiceRelationshipConnection { - __typename - nodes { - __typename - endService { - __typename - ...BaseServiceInfo - } - id - startService { - __typename - ...BaseServiceInfo - } - type - } - } - - fragment ServiceInfoWithChildren on MyService { - __typename - dependedOn { - __typename - ...BaseServiceRelationships - } - dependsOn { - __typename - ...BaseServiceRelationships - } - ...BaseServiceInfo - } - - fragment ServiceRelationshipsWithGrandchildren on ServiceRelationshipConnection { - __typename - nodes { - __typename - endService { - __typename - ...ServiceInfoWithChildren - } - id - startService { - __typename - ...ServiceInfoWithChildren - } - type - } - } -variables: - var1: "service-1" -serviceCalls: - - serviceName: "Users" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - service(id: $v0) { - __typename - dependedOn { - __typename - nodes { - __typename - endService { - __typename - dependedOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - dependsOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - id - name - } - id - startService { - __typename - dependedOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - dependsOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - id - name - } - type - } - } - dependsOn { - __typename - nodes { - __typename - endService { - __typename - dependedOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - dependsOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - id - name - } - id - startService { - __typename - dependedOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - dependsOn { - __typename - nodes { - __typename - endService { - __typename - id - name - } - id - startService { - __typename - id - name - } - type - } - } - id - name - } - type - } - } - id - name - } - } - variables: {"v0":"service-1"} - # language=JSON - response: |- - { - "data": { - "service": { - "__typename": "Service", - "id": "service-0", - "name": "API Gateway", - "dependedOn": { - "__typename": "RelationshipConnection", - "nodes": [ - { - "__typename": "Relationship", - "id": "relationship-1", - "type": "unsure", - "endService": null, - "startService": { - "__typename": "Service", - "id": "service-1", - "name": "GraphQL Gateway", - "dependsOn": null, - "dependedOn": null - } - } - ] - }, - "dependsOn": { - "__typename": "RelationshipConnection", - "nodes": [] - } - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "service": { - "__typename": "MyService", - "id": "service-0", - "name": "API Gateway", - "dependedOn": { - "__typename": "ServiceRelationshipConnection", - "nodes": [ - { - "__typename": "ServiceRelationship", - "id": "relationship-1", - "type": "unsure", - "endService": null, - "startService": { - "__typename": "MyService", - "id": "service-1", - "name": "GraphQL Gateway", - "dependsOn": null, - "dependedOn": null - } - } - ] - }, - "dependsOn": { - "__typename": "ServiceRelationshipConnection", - "nodes": [] - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml b/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml deleted file mode 100644 index 4991deb02..000000000 --- a/test/src/test/resources/fixtures/renames/variable-referenced-input-types-rename-works-as-expected.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: "variable referenced input types rename works as expected" -enabled: true -# language=GraphQL -overallSchema: - MyService: | - type Query { - hello: World - renameObject: ObjectOverall @renamed(from: "renameObjectUnderlying") # the field is renamed - renameInterface: InterfaceOverall @renamed(from: "renameInterfaceUnderlying") - renameUnion: UnionOverall @renamed(from: "renameUnionUnderlying") - renameInput(arg1: InputOverall!, arg2: URL, arg3: EnumOverall): String - renameString: String @renamed(from: "renameStringUnderlying") - typenameTest: TypenameTest - } - type World { - id: ID - name: String - } - type ObjectOverall implements InterfaceOverall @renamed(from: "ObjectUnderlying") { - name: String - } - interface InterfaceOverall @renamed(from: "InterfaceUnderlying") { - name: String - } - union UnionOverall @renamed(from: "UnionUnderlying") = X | Y - type X @renamed(from: "XUnderlying") { - x: Int - } - type Y @renamed(from: "YUnderlying") { - y: Int - } - input InputOverall @renamed(from: "InputUnderlying") { - inputVal: String - } - scalar URL @renamed(from: "String") - enum EnumOverall @renamed(from: "EnumUnderlying") { - X, Y - } - type TypenameTest { - object: ObjectOverall - objects: [ObjectOverall] - } -# language=GraphQL -underlyingSchema: - MyService: | - interface InterfaceUnderlying { - name: String - } - - union UnionUnderlying = XUnderlying | YUnderlying - - type ObjectUnderlying implements InterfaceUnderlying { - name: String - } - - type Query { - hello: World - renameInput(arg1: InputUnderlying!, arg2: String, arg3: EnumUnderlying): String - renameInterfaceUnderlying: InterfaceUnderlying - renameObjectUnderlying: ObjectUnderlying - renameStringUnderlying: String - renameUnionUnderlying: UnionUnderlying - typenameTest: TypenameTest - } - - type TypenameTest { - object: ObjectUnderlying - objects: [ObjectUnderlying] - } - - type World { - id: ID - name: String - } - - type XUnderlying { - x: Int - } - - type YUnderlying { - y: Int - } - - enum EnumUnderlying { - X - Y - } - - input InputUnderlying { - inputVal: String - } -# language=GraphQL -query: | - query X($var1: InputOverall!, $var2: URL, $var3: EnumOverall) { - renameInput(arg1: $var1, arg2: $var2, arg3: $var3) - } -variables: - var1: - inputVal: "x" -serviceCalls: - - serviceName: "MyService" - request: - # language=GraphQL - query: | - query X($v0: InputUnderlying!) { - renameInput(arg1: $v0) - } - variables: {"v0":{"inputVal":"x"}} - operationName: "X" - # language=JSON - response: |- - { - "data": { - "renameInput": "done" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "renameInput": "done" - }, - "extensions": { - "resultComplexity": { - "totalNodeCount": 2, - "serviceNodeCounts": { - "MyService": 2 - }, - "fieldRenamesCount": 0, - "typeRenamesCount": 0 - } - } - } diff --git a/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml b/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml deleted file mode 100644 index a1c2c583f..000000000 --- a/test/src/test/resources/fixtures/result merging/calls-to-multiple-services-are-merged.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: "calls to multiple services are merged" -enabled: true -# language=GraphQL -overallSchema: - foo: | - type Query { - foo(id: ID!): Foo - } - type Foo { - name: String - } - bar: | - type Query { - bar(id: ID!): Bar - } - type Bar { - name: String - } -# language=GraphQL -underlyingSchema: - foo: | - type Query { - foo(id: ID!): Foo - } - type Foo { - name: String - } - bar: | - type Query { - bar(id: ID!): Bar - } - type Bar { - name: String - } -# language=GraphQL -query: | - query { - loot: foo(id: "1") { - name - } - foo(id: "1") { - name - } - bar(id: "1") { - name - } - } -variables: { } -serviceCalls: - - serviceName: "foo" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - foo(id: $v0) { - name - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "foo": { - "name": "Hello" - } - }, - "extensions": {} - } - - serviceName: "foo" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - loot: foo(id: $v0) { - name - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "loot": { - "name": "World" - } - }, - "extensions": {} - } - - serviceName: "bar" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - bar(id: $v0) { - name - } - } - variables: {"v0":"1"} - # language=JSON - response: |- - { - "data": { - "bar": { - "name": "Bart" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "loot": { - "name": "World" - }, - "foo": { - "name": "Hello" - }, - "bar": { - "name": "Bart" - } - }, - "errors": [] - } diff --git a/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml b/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml deleted file mode 100644 index b69710f22..000000000 --- a/test/src/test/resources/fixtures/scalars/date-time-scalar-as-input-type.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: "date time scalar as input type" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo(input: DateTime): Foo - } - type Foo { - thing: JSON - } - scalar JSON - scalar DateTime -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo(input: DateTime): Foo - } - type Foo { - thing: JSON - } - scalar JSON - scalar DateTime -query: | - query { - foo(input: "2022-03-09T05:01:50Z") { - thing - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: DateTime) { - foo(input: $v0) { - thing - } - } - variables: {"v0":"2022-03-09T05:01:50Z"} - # language=JSON - response: |- - { - "data": { - "foo": { - "thing": "What, were you expecting something else?" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "thing": "What, were you expecting something else?" - } - } - } diff --git a/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml b/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml deleted file mode 100644 index 0dcf8a600..000000000 --- a/test/src/test/resources/fixtures/scalars/hydrating-json-data.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: "hydrating json data" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo(input: JSON): Foo - } - type Foo { - id: ID! - foo: Foo @hydrated( - service: "Baz" - field: "otherFoo" - arguments: [{ name: "id" value: "$source.id" }] - ) - } - Baz: | - type Query { - otherFoo(id: ID!): Foo @hidden - } - Shared: | - scalar JSON -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo(input: JSON): Foo - } - type Foo { - id: ID! - } - scalar JSON - Baz: | - type Query { - otherFoo(id: ID!): Foo - } - type Foo { - id: ID! - } - Shared: | - type Query { - echo: String - } - scalar JSON -query: | - query { - foo(input: {something: true answer: "42"}) { - foo { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: JSON) { - foo(input: $v0) { - __typename__hydration__foo: __typename - hydration__foo__id: id - } - } - variables: {"v0":{"something":true,"answer":"42"}} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__foo": "Foo", - "hydration__foo__id": "10000" - } - }, - "extensions": {} - } - - serviceName: "Baz" - request: - # language=GraphQL - query: | - query ($v0: ID!) { - otherFoo(id: $v0) { - id - } - } - variables: {"v0":"10000"} - # language=JSON - response: |- - { - "data": { - "otherFoo": { - "id": "-10000" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "foo": { - "id": "-10000" - } - } - } - } diff --git a/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml b/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml deleted file mode 100644 index 5cf56b259..000000000 --- a/test/src/test/resources/fixtures/scalars/hydrating-using-date-time-as-arg.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: "hydrating using date time as arg" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo: Foo - successor(after: DateTime): Foo - } - type Foo { - id: ID - createdAt: DateTime - successor: Foo - @hydrated( - service: "service" - field: "successor" - arguments: [{ name: "after" value: "$source.createdAt" }] - ) - } - scalar DateTime -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo: Foo - successor(after: DateTime): Foo - } - type Foo { - id: ID - createdAt: DateTime - successor: Foo - } - scalar DateTime -query: | - query { - foo { - successor { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__successor: __typename - hydration__successor__createdAt: createdAt - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__successor": "Foo", - "hydration__successor__createdAt": "2022-03-09T05:01:50Z" - } - }, - "extensions": {} - } - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: DateTime) { - successor(after: $v0) { - id - } - } - variables: {"v0":"2022-03-09T05:01:50Z"} - # language=JSON - response: |- - { - "data": { - "successor": { - "id": "2023" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "successor": { - "id": "2023" - } - } - } - } diff --git a/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml b/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml deleted file mode 100644 index e16261a34..000000000 --- a/test/src/test/resources/fixtures/scalars/hydrating-using-long-as-arg.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: "hydrating using long as arg" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo: Foo - successor(after: Long): Foo - } - type Foo { - id: ID - createdAt: Long - successor: Foo - @hydrated( - service: "service" - field: "successor" - arguments: [{ name: "after" value: "$source.createdAt" }] - ) - } - scalar Long -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo: Foo - successor(after: Long): Foo - } - type Foo { - id: ID - createdAt: Long - successor: Foo - } - scalar Long -query: | - query { - foo { - successor { - id - } - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__successor: __typename - hydration__successor__createdAt: createdAt - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__successor": "Foo", - "hydration__successor__createdAt": 3000000000 - } - }, - "extensions": {} - } - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: Long) { - successor(after: $v0) { - id - } - } - variables: {"v0":3000000000} - # language=JSON - response: |- - { - "data": { - "successor": { - "id": "2023" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "successor": { - "id": "2023" - } - } - } - } diff --git a/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml b/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml deleted file mode 100644 index 1c4c01de2..000000000 --- a/test/src/test/resources/fixtures/scalars/hydrating-using-url-as-arg.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: "hydrating using url as arg" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo: Foo - lookup(url: URL): Lookup @hidden - } - type Foo { - id: ID - url: URL - details: Lookup - @hydrated( - service: "service" - field: "lookup" - arguments: [{ name: "url" value: "$source.url" }] - ) - } - type Lookup { - baseUrl: URL - createdAt: DateTime - owner: String - } - scalar URL - scalar DateTime -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo: Foo - lookup(url: URL): Lookup - } - type Foo { - id: ID - url: URL - } - type Lookup { - baseUrl: URL - createdAt: DateTime - owner: String - } - scalar URL - scalar DateTime -query: | - query { - foo { - url - details { - baseUrl - owner - createdAt - } - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - { - foo { - __typename__hydration__details: __typename - url - hydration__details__url: url - } - } - variables: {} - # language=JSON - response: |- - { - "data": { - "foo": { - "__typename__hydration__details": "Foo", - "hydration__details__url": "https://github.com/atlassian-labs/nadel", - "url": "https://github.com/atlassian-labs/nadel" - } - }, - "extensions": {} - } - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: URL) { - lookup(url: $v0) { - baseUrl - createdAt - owner - } - } - variables: {"v0":"https://github.com/atlassian-labs/nadel"} - # language=JSON - response: |- - { - "data": { - "lookup": { - "baseUrl": "https://github.com/", - "createdAt": "2018-02-13T06:23:41Z", - "owner": "amarek" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "url": "https://github.com/atlassian-labs/nadel", - "details": { - "baseUrl": "https://github.com/", - "createdAt": "2018-02-13T06:23:41Z", - "owner": "amarek" - } - } - } - } diff --git a/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml b/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml deleted file mode 100644 index d1a474b8d..000000000 --- a/test/src/test/resources/fixtures/scalars/long-scalar-argument-with-default-values.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: "long scalar argument with default values" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - getFoo(arg: Long = 123): String - } - scalar Long -# language=GraphQL -underlyingSchema: - service: | - type Query { - getFoo(arg: Long = 123): String - } - scalar Long -query: | - query { - getFoo(arg: 15) - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: Long) { - getFoo(arg: $v0) - } - variables: {"v0":15} - # language=JSON - response: |- - { - "data": { - "getFoo": "KFC Good" - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "getFoo": "KFC Good" - } - } diff --git a/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml b/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml deleted file mode 100644 index e4295a4b6..000000000 --- a/test/src/test/resources/fixtures/scalars/long-scalar-as-input-type.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: "long scalar as input type" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo(input: Long): Foo - } - type Foo { - thing: JSON - } - scalar JSON - scalar Long -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo(input: Long): Foo - } - type Foo { - thing: JSON - } - scalar JSON - scalar Long -query: | - query { - foo(input: 3000000000) { - thing - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: Long) { - foo(input: $v0) { - thing - } - } - variables: {"v0":3000000000} - # language=JSON - response: |- - { - "data": { - "foo": { - "thing": "What, were you expecting something else?" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "thing": "What, were you expecting something else?" - } - } - } diff --git a/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml b/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml deleted file mode 100644 index 87045272e..000000000 --- a/test/src/test/resources/fixtures/scalars/url-scalar-as-input-type.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: "url scalar as input type" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo(input: URL): Foo - } - type Foo { - thing: JSON - } - scalar JSON - scalar URL -# language=GraphQL -underlyingSchema: - service: | - type Query { - foo(input: URL): Foo - } - type Foo { - thing: JSON - } - scalar JSON - scalar URL -query: | - query { - foo(input: "https://atlassian.com") { - thing - } - } -variables: { } -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: URL) { - foo(input: $v0) { - thing - } - } - variables: {"v0":"https://atlassian.com"} - # language=JSON - response: |- - { - "data": { - "foo": { - "thing": "What, were you expecting something else?" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "thing": "What, were you expecting something else?" - } - } - } diff --git a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml b/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml deleted file mode 100644 index 7fe398e54..000000000 --- a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-field-with-hydrated-parent.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: "handles include directive field with hydrated parent" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foo: Foo @renamed(from: "bar") - fooById(id: ID): Foo - } - type Foo { - id: String - water: Foo @hydrated( - service: "service" - field: "fooById" - arguments: [ - {name: "id" value: "$source.id"} - ] - ) - } -# language=GraphQL -underlyingSchema: - service: | - type Query { - bar: Foo - fooById(id: ID): Foo - } - type Foo { - id: String - } -# language=GraphQL -query: | - query ($test: Boolean!) { - foo { - water { - id @include(if: $test) - } - } - } -variables: - test: false -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query { - rename__foo__bar: bar { - __typename__hydration__water: __typename - hydration__water__id: id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "rename__foo__bar": { - "__typename__hydration__water": "Foo", - "hydration__water__id": "Foo-1" - } - }, - "extensions": {} - } - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: ID) { - fooById(id: $v0) { - __typename__skip_include____skip: __typename - } - } - variables: {"v0":"Foo-1"} - # language=JSON - response: |- - { - "data": { - "fooById": { - "__typename__skip_include____skip": "Foo" - } - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foo": { - "water": { - } - } - }, - "extensions": {} - } diff --git a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml b/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml deleted file mode 100644 index 463b0aba7..000000000 --- a/test/src/test/resources/fixtures/skip-include-fields/hydration/handles-include-directive-on-field-with-batch-hydrated-parent.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: "handles include directive on field with batch hydrated parent" -enabled: true -# language=GraphQL -overallSchema: - service: | - type Query { - foos: [Foo] - tests(ids: [ID]): [Test] - } - type Foo { - test: Test @hydrated( - service: "service" - field: "tests" - arguments: [ - {name: "ids" value: "$source.id"} - ] - identifiedBy: "id" - ) - } - type Test { - id: ID - } -# language=GraphQL -underlyingSchema: - service: | - type Query { - foos: [Foo] - tests(ids: [ID]): [Test] - } - type Foo { - id: String - } - type Test { - id: ID - } -# language=GraphQL -query: | - query ($test: Boolean!) { - foos { - test { - id @include(if: $test) - } - } - } -variables: - test: false -serviceCalls: - - serviceName: "service" - request: - # language=GraphQL - query: | - query { - foos { - __typename__batch_hydration__test: __typename - batch_hydration__test__id: id - } - } - variables: { } - # language=JSON - response: |- - { - "data": { - "foos": [ - { - "__typename__batch_hydration__test": "Foo", - "batch_hydration__test__id": "Foo-3" - }, - { - "__typename__batch_hydration__test": "Foo", - "batch_hydration__test__id": "Foo-4" - } - ] - }, - "extensions": {} - } - - serviceName: "service" - request: - # language=GraphQL - query: | - query ($v0: [ID]) { - tests(ids: $v0) { - __typename__skip_include____skip: __typename - batch_hydration__test__id: id - } - } - variables: {"v0":["Foo-3","Foo-4"]} - # language=JSON - response: |- - { - "data": { - "tests": [ - { - "__typename__skip_include____skip": "Foo", - "batch_hydration__test__id": "Foo-4" - }, - { - "__typename__skip_include____skip": "Foo", - "batch_hydration__test__id": "Foo-3" - } - ] - }, - "extensions": {} - } -# language=JSON -response: |- - { - "data": { - "foos": [ - { - "test": {} - }, - { - "test": {} - } - ] - }, - "extensions": {} - }