GraphQuery

Marks a Retrofit interface method as a GraphQL operation.

The annotation value must match the name of a .graphql file (without extension) in the configured assets directory (default: graphql/). At runtime, the co.anitrend.retrofit.graphql.annotation.processor.GraphProcessor discovers the file and injects its contents into the request body.

Example:

@POST("/graphql")
@GraphQuery("GetMarketPlaceApps")
suspend fun getMarketPlaceApps(@Body builder: QueryContainerBuilder): Response<GraphContainer<MarketPlaceListings>>

Parameters

value

The operation name, matching a .graphql file in assets (without extension).

See also

co.anitrend.retrofit.graphql.model.GraphQLRequest
co.anitrend.retrofit.graphql.model.GraphQLDocumentRegistry

Properties

Link copied to clipboard