Skip to content

Commit

Permalink
Update GraphQL extends directive to include class argument, include S…
Browse files Browse the repository at this point in the history
…trictDate in GraphQL SDL tests (finos#2480)

* Update simpleTest.pure

* Update simpleTest.pure

* Update bindingCommon.pure

* Update simpleTest.pure

* Update simpleTest.pure
  • Loading branch information
horbe authored and AFine-gs committed Jan 9, 2024
1 parent c09e90d commit 643b441
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ function meta::external::query::graphQL::binding::temporalityToDirectives(): Map

function meta::external::query::graphQL::binding::hierarchyDirective(): DirectiveDefinition[1]
{
^DirectiveDefinition(name = 'extends', typeSystemLocation = [TypeSystemDirectiveLocation.OBJECT, TypeSystemDirectiveLocation.INPUT_OBJECT]);
}
^DirectiveDefinition(name = 'extends', argumentDefinitions = [^InputValueDefinition(name = 'class', type = ^NamedTypeReference(nullable = false, name = 'String'))], typeSystemLocation = [TypeSystemDirectiveLocation.OBJECT, TypeSystemDirectiveLocation.INPUT_OBJECT]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Class meta::external::query::graphQL::binding::fromPure::sdl::tests::model::Clas
date: Date[1];
datetime: DateTime[1];
decimal: Decimal[1];
strictDate: StrictDate[1];
}

Class <<GraphQL.Mutation>> meta::external::query::graphQL::binding::fromPure::sdl::tests::model::MutationPrimitive
Expand Down Expand Up @@ -178,11 +179,14 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
' date: Date!\n' +
' datetime: DateTime!\n' +
' decimal: BigDecimal!\n' +
' strictDate: StrictDate!\n' +
'}\n' +
'\n' +
'scalar Date\n' +
'\n' +
'scalar DateTime', $res);
'scalar DateTime\n' +
'\n' +
'scalar StrictDate', $res);
}

function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::tests::testNonBuiltInPrimitiveTypesAreNotDuplicated():Boolean[1]
Expand All @@ -200,6 +204,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
' date: Date!\n' +
' datetime: DateTime!\n' +
' decimal: BigDecimal!\n' +
' strictDate: StrictDate!\n' +
'}\n' +
'\n' +
'input ClassWithPrimitiveTypesInput {\n' +
Expand All @@ -210,6 +215,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
' date: Date!\n' +
' datetime: DateTime!\n' +
' decimal: BigDecimal!\n' +
' strictDate: StrictDate!\n' +
'}\n' +
'\n' +
'scalar Date\n' +
Expand All @@ -220,6 +226,8 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
' upsertClass(class: ClassWithPrimitiveTypesInput!): ClassWithPrimitiveTypes\n' +
'}\n' +
'\n' +
'scalar StrictDate\n' +
'\n' +
'schema {\n' +
' mutation : MutationPrimitive\n' +
'}', $res);
Expand Down Expand Up @@ -265,7 +273,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
'\n' +
'scalar StrictDate\n' +
'\n' +
'directive @extends on OBJECT | INPUT_OBJECT',
'directive @extends(class: String!) on OBJECT | INPUT_OBJECT',
$res);
}

Expand Down Expand Up @@ -313,7 +321,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
'\n' +
'scalar StrictDate\n' +
'\n' +
'directive @extends on OBJECT | INPUT_OBJECT',
'directive @extends(class: String!) on OBJECT | INPUT_OBJECT',
$res);
}

Expand Down Expand Up @@ -349,7 +357,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
' members: [Employee!]!\n' +
'}\n' +
'\n' +
'directive @extends on OBJECT | INPUT_OBJECT',
'directive @extends(class: String!) on OBJECT | INPUT_OBJECT',
$res);
}

Expand Down Expand Up @@ -414,7 +422,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::fromPure::sdl::t
' members: [EmployeeInput!]!\n' +
'}\n' +
'\n' +
'directive @extends on OBJECT | INPUT_OBJECT\n' +
'directive @extends(class: String!) on OBJECT | INPUT_OBJECT\n' +
'\n' +
'schema {\n' +
' query : QueryHierarchy\n' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,16 @@ function <<test.Test>> meta::external::query::graphQL::binding::toPure::sdl::tes
' date: Date!\n' +
' datetime: DateTime!\n' +
' decimal: BigDecimal!\n' +
' strictDate: StrictDate!\n' +
'}\n' +
'\n' +
'scalar Date\n' +
'\n' +
'scalar DateTime\n' +
'\n' +
'scalar BigDecimal\n' +
'\n' +
'scalar StrictDate\n' +
'}#',
'meta::external::query::graphQL::metamodel::sql'
);
Expand All @@ -193,6 +196,7 @@ function <<test.Test>> meta::external::query::graphQL::binding::toPure::sdl::tes
' date : Date[1];\n' +
' datetime : DateTime[1];\n' +
' decimal : Decimal[1];\n' +
' strictDate : StrictDate[1];\n' +
'}',
$pureTypes);
}
Expand Down Expand Up @@ -511,4 +515,4 @@ function <<access.private>> meta::external::query::graphQL::binding::toPure::sdl
->sortBy(t | $t->elementToPath())
->map(t | $t->meta::pure::metamodel::serialization::grammar::printType())
->joinStrings('\n\n');
}
}

0 comments on commit 643b441

Please sign in to comment.