-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql -- https://github.com/dillonkearns/elm-graphql module Github.Object.Gist exposing (CommentsOptionalArguments, StargazersOptionalArguments, comments, createdAt, description, id, isPublic, name, owner, pushedAt, selection, stargazers, updatedAt, viewerHasStarred) import Github.InputObject import Github.Interface import Github.Object import Github.Scalar import Github.Union import Graphql.Field as Field exposing (Field) 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.OptionalArgument exposing (OptionalArgument(..)) import Graphql.SelectionSet exposing (SelectionSet) import Json.Decode as Decode {-| Select fields to build up a SelectionSet for this object. -} selection : (a -> constructor) -> SelectionSet (a -> constructor) Github.Object.Gist selection constructor = Object.selection constructor type alias CommentsOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String } {-| A list of comments associated with the gist - first - Returns the first _n_ elements from the list. - after - Returns the elements in the list that come after the specified global ID. - last - Returns the last _n_ elements from the list. - before - Returns the elements in the list that come before the specified global ID. -} comments : (CommentsOptionalArguments -> CommentsOptionalArguments) -> SelectionSet decodesTo Github.Object.GistCommentConnection -> Field decodesTo Github.Object.Gist comments fillInOptionals object_ = let filledInOptionals = fillInOptionals { first = Absent, after = Absent, last = Absent, before = Absent } optionalArgs = [ Argument.optional "first" filledInOptionals.first Encode.int, Argument.optional "after" filledInOptionals.after Encode.string, Argument.optional "last" filledInOptionals.last Encode.int, Argument.optional "before" filledInOptionals.before Encode.string ] |> List.filterMap identity in Object.selectionField "comments" optionalArgs object_ identity {-| Identifies the date and time when the object was created. -} createdAt : Field Github.Scalar.DateTime Github.Object.Gist createdAt = Object.fieldDecoder "createdAt" [] (Decode.oneOf [ Decode.string, Decode.float |> Decode.map Debug.toString, Decode.int |> Decode.map Debug.toString, Decode.bool |> Decode.map Debug.toString ] |> Decode.map Github.Scalar.DateTime) {-| The gist description. -} description : Field (Maybe String) Github.Object.Gist description = Object.fieldDecoder "description" [] (Decode.string |> Decode.nullable) id : Field Github.Scalar.Id Github.Object.Gist id = Object.fieldDecoder "id" [] (Decode.oneOf [ Decode.string, Decode.float |> Decode.map Debug.toString, Decode.int |> Decode.map Debug.toString, Decode.bool |> Decode.map Debug.toString ] |> Decode.map Github.Scalar.Id) {-| Whether the gist is public or not. -} isPublic : Field Bool Github.Object.Gist isPublic = Object.fieldDecoder "isPublic" [] Decode.bool {-| The gist name. -} name : Field String Github.Object.Gist name = Object.fieldDecoder "name" [] Decode.string {-| The gist owner. -} owner : SelectionSet decodesTo Github.Interface.RepositoryOwner -> Field (Maybe decodesTo) Github.Object.Gist owner object_ = Object.selectionField "owner" [] object_ (identity >> Decode.nullable) {-| Identifies when the gist was last pushed to. -} pushedAt : Field (Maybe Github.Scalar.DateTime) Github.Object.Gist pushedAt = Object.fieldDecoder "pushedAt" [] (Decode.oneOf [ Decode.string, Decode.float |> Decode.map Debug.toString, Decode.int |> Decode.map Debug.toString, Decode.bool |> Decode.map Debug.toString ] |> Decode.map Github.Scalar.DateTime |> Decode.nullable) type alias StargazersOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String, orderBy : OptionalArgument Github.InputObject.StarOrder } {-| A list of users who have starred this starrable. - first - Returns the first _n_ elements from the list. - after - Returns the elements in the list that come after the specified global ID. - last - Returns the last _n_ elements from the list. - before - Returns the elements in the list that come before the specified global ID. - orderBy - Order for connection -} stargazers : (StargazersOptionalArguments -> StargazersOptionalArguments) -> SelectionSet decodesTo Github.Object.StargazerConnection -> Field decodesTo Github.Object.Gist stargazers fillInOptionals object_ = let filledInOptionals = fillInOptionals { first = Absent, after = Absent, last = Absent, before = Absent, orderBy = Absent } optionalArgs = [ Argument.optional "first" filledInOptionals.first Encode.int, Argument.optional "after" filledInOptionals.after Encode.string, Argument.optional "last" filledInOptionals.last Encode.int, Argument.optional "before" filledInOptionals.before Encode.string, Argument.optional "orderBy" filledInOptionals.orderBy Github.InputObject.encodeStarOrder ] |> List.filterMap identity in Object.selectionField "stargazers" optionalArgs object_ identity {-| Identifies the date and time when the object was last updated. -} updatedAt : Field Github.Scalar.DateTime Github.Object.Gist updatedAt = Object.fieldDecoder "updatedAt" [] (Decode.oneOf [ Decode.string, Decode.float |> Decode.map Debug.toString, Decode.int |> Decode.map Debug.toString, Decode.bool |> Decode.map Debug.toString ] |> Decode.map Github.Scalar.DateTime) {-| Returns a boolean indicating whether the viewing user has starred this starrable. -} viewerHasStarred : Field Bool Github.Object.Gist viewerHasStarred = Object.fieldDecoder "viewerHasStarred" [] Decode.bool