-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
lib/src/main/java/graphql/nadel/definition/virtualType/NadelVirtualTypeDefinition.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,26 @@ | ||
package graphql.nadel.definition.virtualType | ||
|
||
import graphql.language.DirectiveDefinition | ||
import graphql.nadel.engine.util.parseDefinition | ||
import graphql.schema.GraphQLDirectiveContainer | ||
import graphql.schema.GraphQLSchemaElement | ||
|
||
internal fun GraphQLSchemaElement.isVirtualType(): Boolean { | ||
return (this as? GraphQLDirectiveContainer) | ||
?.hasAppliedDirective(NadelVirtualTypeDefinition.directiveDefinition.name) == true | ||
} | ||
|
||
internal class NadelVirtualTypeDefinition { | ||
companion object { | ||
val directiveDefinition = parseDefinition<DirectiveDefinition>( | ||
// language=GraphQL | ||
""" | ||
directive @virtualType on OBJECT | ||
""".trimIndent(), | ||
) | ||
} | ||
|
||
object Keyword { | ||
const val virtualType = "virtualType" | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
lib/src/main/java/graphql/nadel/definition/virtualType/NadelVirtualTypeDirective.kt
This file was deleted.
Oops, something went wrong.
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
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
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
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