-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be robust to SDL schemas that already contain builtin definitions (#3241
- Loading branch information
1 parent
6e2fd16
commit 57112ca
Showing
5 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
apollo-graphql-ast/src/test/kotlin/com/apollographql/apollo3/graphql/ast/test/SchemaTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.apollographql.apollo3.graphql.ast.test | ||
|
||
import com.apollographql.apollo3.ast.toSchema | ||
import org.junit.Test | ||
|
||
class SchemaTest { | ||
@Test | ||
fun schemaMayContainBuiltinDirectives() { | ||
val schemaString = """ | ||
"Directs the executor to include this field or fragment only when the `if` argument is true" | ||
directive @include( | ||
"Included when true." | ||
if: Boolean! | ||
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT | ||
type Query { | ||
foo: Int | ||
} | ||
""".trimIndent() | ||
|
||
schemaString.toSchema() | ||
} | ||
} |