Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 2.48 KB

File metadata and controls

63 lines (52 loc) · 2.48 KB

Annotations

You can register your code through the following annotations which are provided by this integration.

Defines a resolver using the given container name and field name.

Example:

@GQLResolver("Query", "getMe")
class QueryGetUserResolver : DataFetcher<Any> {
    override fun get(env: DataFetchingEnvironment): Any = TODO("implement")
}

Defines a new TypeResolver for the given type name and scope.

Example:

@GQLTypeResolver("User", GQLTypeResolver.Scope.INTERFACE)
class UserTypeResolver : TypeResolver {
    override fun getType(env: TypeResolutionEnvironment?): GraphQLObjectType = TODO("implement")
}

Defines a new Scalar for the given scalar name.

Example:

@GQLScalar("NewString")
class NewStringCoercing : Coercing<String, String> {
    override fun parseValue(input: Any): String = TODO("implement")
    override fun parseLiteral(input: Any?): String = TODO("implement")
    override fun serialize(dataFetcherResult: Any): String = TODO("implement")
}

Defines a new Directive for the given directive name.

Example:

@GQLDirective("authentication")
class AuthenticationDirective : SchemaDirectiveWiring {
    override fun onField(env: SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition>): GraphQLFieldDefinition = TODO("implement")
}

Defines multiple resolvers for the given GQLResolver.

Example:

@GQLResolvers(
    GQLResolver("PrivateUser", "age"),
    GQLResolver("PublicUser", "age")
)
class UserAgeResolver : DataFetcher<Any> {
    override fun get(env: DataFetchingEnvironment): Any = TODO("implement")
}