-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql -- https://github.com/dillonkearns/elm-graphql module Normalize.Interface.Character exposing (Fragments, appearsIn, fragments, friends, id, maybeFragments, name) import Graphql.Internal.Builder.Argument as Argument exposing (Argument) import Graphql.Internal.Builder.Object as Object import Graphql.Internal.Encode as Encode exposing (Value) import Graphql.Operation exposing (RootMutation, RootQuery, RootSubscription) import Graphql.OptionalArgument exposing (OptionalArgument(..)) import Graphql.SelectionSet exposing (FragmentSelectionSet(..), SelectionSet(..)) import Json.Decode as Decode import Normalize.Enum.Episode_ import Normalize.InputObject import Normalize.Interface import Normalize.Object import Normalize.Scalar import Normalize.ScalarCodecs import Normalize.Union type alias Fragments decodesTo = { onHuman_ : SelectionSet decodesTo Normalize.Object.Human_ , onDroid : SelectionSet decodesTo Normalize.Object.Droid } {-| Build an exhaustive selection of type-specific fragments. -} fragments : Fragments decodesTo -> SelectionSet decodesTo Normalize.Interface.Character fragments selections = Object.exhuastiveFragmentSelection [ Object.buildFragment "_human" selections.onHuman_ , Object.buildFragment "Droid" selections.onDroid ] {-| Can be used to create a non-exhuastive set of fragments by using the record update syntax to add `SelectionSet`s for the types you want to handle. -} maybeFragments : Fragments (Maybe decodesTo) maybeFragments = { onHuman_ = Graphql.SelectionSet.empty |> Graphql.SelectionSet.map (\_ -> Nothing) , onDroid = Graphql.SelectionSet.empty |> Graphql.SelectionSet.map (\_ -> Nothing) } {-| Which movies they appear in. -} appearsIn : SelectionSet (List Normalize.Enum.Episode_.Episode_) Normalize.Interface.Character appearsIn = Object.selectionForField "(List Enum.Episode_.Episode_)" "appearsIn" [] (Normalize.Enum.Episode_.decoder |> Decode.list) {-| The friends of the character, or an empty list if they have none. -} friends : SelectionSet decodesTo Normalize.Interface.Character -> SelectionSet (List decodesTo) Normalize.Interface.Character friends object_ = Object.selectionForCompositeField "friends" [] object_ (identity >> Decode.list) {-| The ID of the character. -} id : SelectionSet Normalize.ScalarCodecs.Id Normalize.Interface.Character id = Object.selectionForField "ScalarCodecs.Id" "id" [] (Normalize.ScalarCodecs.codecs |> Normalize.Scalar.unwrapCodecs |> .codecId |> .decoder) {-| The name of the character. -} name : SelectionSet String Normalize.Interface.Character name = Object.selectionForField "String" "name" [] Decode.string