com.lahzouz.apollo.graphql.client.GetBooksQuery.kt Maven / Gradle / Ivy
//
// AUTO-GENERATED FILE. DO NOT MODIFY.
//
// This class was automatically generated by Apollo GraphQL version '3.0.0'.
//
package com.lahzouz.apollo.graphql.client
import com.apollographql.apollo3.api.Adapter
import com.apollographql.apollo3.api.CompiledField
import com.apollographql.apollo3.api.CustomScalarAdapters
import com.apollographql.apollo3.api.Query
import com.apollographql.apollo3.api.json.JsonWriter
import com.apollographql.apollo3.api.obj
import com.lahzouz.apollo.graphql.client.adapter.GetBooksQuery_ResponseAdapter
import com.lahzouz.apollo.graphql.client.selections.GetBooksQuerySelections
import java.lang.Long
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
public class GetBooksQuery() : Query {
public override fun id(): String = OPERATION_ID
public override fun document(): String = OPERATION_DOCUMENT
public override fun name(): String = OPERATION_NAME
public override fun serializeVariables(writer: JsonWriter,
customScalarAdapters: CustomScalarAdapters): Unit {
// This operation doesn't have any variable
}
public override fun adapter(): Adapter {
return GetBooksQuery_ResponseAdapter.Data.obj()
}
public override fun rootField(): CompiledField = CompiledField.Builder(
name = "data",
type = com.lahzouz.apollo.graphql.client.type.Query.type
)
.selections(selections = GetBooksQuerySelections.root)
.build()
public data class Data(
public val books: List
) : Query.Data
public data class Book(
public val id: Long,
public val title: String,
public val author: Author
)
public data class Author(
public val name: String
)
public companion object {
public const val OPERATION_ID: String =
"4c33fd9fc50eee000565e2020e2cf5a02aff74b4ba2e132ea817a894ad79781b"
/**
* The minimized GraphQL document being sent to the server to save a few bytes.
* The un-minimized version is:
*
* query GetBooks {
* books {
* id
* title
* author {
* name
* }
* }
* }
*/
public const val OPERATION_DOCUMENT: String =
"query GetBooks { books { id title author { name } } }"
public const val OPERATION_NAME: String = "GetBooks"
}
}