async-graphql/tests/schemas/test_entity_inaccessible.schema.graphql
Dominik Spicher b020ce5aee tests/federation: compare export_sdl against expected schema
This commit adds logic to two unit tests where the schema
export is compared against expected output cached in two
schema files.

This is intended to help prevent bugs like the ones fixed in
faf407b or the immediately succeeding commit, as unexpected
changes to schema export will become apparent in the commit
diff, easing reviews.

When legitimately changing the export output behaviour,
the test suite just needs to be run twice, as the unit-tests
automatically overwrite the files with the new version.

This unit-test approach is inspired by

https://matklad.github.io/2022/03/26/self-modifying-code.html
2022-08-29 22:23:28 +02:00

68 lines
1.5 KiB
GraphQL

type MyCustomObjInaccessible @inaccessible {
a: Int!
customObjectInaccessible: Int! @inaccessible
}
enum MyEnumInaccessible @inaccessible{
OPTION_A
OPTION_B
OPTION_C
}
enum MyEnumVariantInaccessible{
OPTION_A_INACCESSIBLE @inaccessible
OPTION_B
OPTION_C
}
input MyInputObjFieldInaccessible{
inputFieldInaccessibleA: Int! @inaccessible
}
input MyInputObjInaccessible @inaccessible{
a: Int!
}
interface MyInterfaceInaccessible @inaccessible {
inaccessibleInterfaceValue: String! @inaccessible
}
type MyInterfaceObjA implements MyInterfaceInaccessible {
inaccessibleInterfaceValue: String!
}
type MyInterfaceObjB implements MyInterfaceInaccessible @inaccessible {
inaccessibleInterfaceValue: String!
}
scalar MyNumberInaccessible @inaccessible
type MyObjFieldInaccessible @key(fields: "id") {
objFieldInaccessibleA: Int! @inaccessible
}
type MyObjInaccessible @key(fields: "id") @inaccessible {
a: Int!
}
union MyUnionInaccessible @inaccessible = MyInterfaceObjA | MyInterfaceObjB
extend type Query {
enumVariantInaccessible(id: Int!): MyEnumVariantInaccessible!
enumInaccessible(id: Int!): MyEnumInaccessible!
inaccessibleField(id: Int!): Int! @inaccessible
inaccessibleArgument(id: Int! @inaccessible): Int!
inaccessibleInterface: MyInterfaceInaccessible!
inaccessibleUnion: MyUnionInaccessible!
inaccessibleScalar: MyNumberInaccessible!
inaccessibleInputField(value: MyInputObjFieldInaccessible!): Int!
inaccessibleInput(value: MyInputObjInaccessible!): Int!
inaccessibleCustomObject: MyCustomObjInaccessible!
}