Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GraphQL extends directive to include class argument, include StrictDate in GraphQL SDL tests #2480

Merged
merged 5 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
}
}
Loading