-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql -- https://github.com/dillonkearns/elm-graphql module Github.Interface.Comment exposing (UserContentEditsOptionalArguments, author, authorAssociation, body, bodyHTML, commonSelection, createdAt, createdViaEmail, editor, id, lastEditedAt, onCommitComment, onGistComment, onIssue, onIssueComment, onPullRequest, onPullRequestReview, onPullRequestReviewComment, publishedAt, selection, updatedAt, userContentEdits, viewerDidAuthor) import Github.Enum.CommentAuthorAssociation 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 (FragmentSelectionSet(..), SelectionSet(..)) import Json.Decode as Decode {-| Select only common fields from the interface. -} commonSelection : (a -> constructor) -> SelectionSet (a -> constructor) Github.Interface.Comment commonSelection constructor = Object.selection constructor {-| Select both common and type-specific fields from the interface. -} selection : (Maybe typeSpecific -> a -> constructor) -> List (FragmentSelectionSet typeSpecific Github.Interface.Comment) -> SelectionSet (a -> constructor) Github.Interface.Comment selection constructor typeSpecificDecoders = Object.interfaceSelection typeSpecificDecoders constructor onCommitComment : SelectionSet decodesTo Github.Object.CommitComment -> FragmentSelectionSet decodesTo Github.Interface.Comment onCommitComment (SelectionSet fields decoder) = FragmentSelectionSet "CommitComment" fields decoder onGistComment : SelectionSet decodesTo Github.Object.GistComment -> FragmentSelectionSet decodesTo Github.Interface.Comment onGistComment (SelectionSet fields decoder) = FragmentSelectionSet "GistComment" fields decoder onIssue : SelectionSet decodesTo Github.Object.Issue -> FragmentSelectionSet decodesTo Github.Interface.Comment onIssue (SelectionSet fields decoder) = FragmentSelectionSet "Issue" fields decoder onIssueComment : SelectionSet decodesTo Github.Object.IssueComment -> FragmentSelectionSet decodesTo Github.Interface.Comment onIssueComment (SelectionSet fields decoder) = FragmentSelectionSet "IssueComment" fields decoder onPullRequest : SelectionSet decodesTo Github.Object.PullRequest -> FragmentSelectionSet decodesTo Github.Interface.Comment onPullRequest (SelectionSet fields decoder) = FragmentSelectionSet "PullRequest" fields decoder onPullRequestReview : SelectionSet decodesTo Github.Object.PullRequestReview -> FragmentSelectionSet decodesTo Github.Interface.Comment onPullRequestReview (SelectionSet fields decoder) = FragmentSelectionSet "PullRequestReview" fields decoder onPullRequestReviewComment : SelectionSet decodesTo Github.Object.PullRequestReviewComment -> FragmentSelectionSet decodesTo Github.Interface.Comment onPullRequestReviewComment (SelectionSet fields decoder) = FragmentSelectionSet "PullRequestReviewComment" fields decoder {-| The actor who authored the comment. -} author : SelectionSet decodesTo Github.Interface.Actor -> Field (Maybe decodesTo) Github.Interface.Comment author object_ = Object.selectionField "author" [] object_ (identity >> Decode.nullable) {-| Author's association with the subject of the comment. -} authorAssociation : Field Github.Enum.CommentAuthorAssociation.CommentAuthorAssociation Github.Interface.Comment authorAssociation = Object.fieldDecoder "authorAssociation" [] Github.Enum.CommentAuthorAssociation.decoder {-| The comment body as Markdown. -} body : Field String Github.Interface.Comment body = Object.fieldDecoder "body" [] Decode.string {-| The comment body rendered to HTML. -} bodyHTML : Field Github.Scalar.Html Github.Interface.Comment bodyHTML = Object.fieldDecoder "bodyHTML" [] (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.Html) {-| Identifies the date and time when the object was created. -} createdAt : Field Github.Scalar.DateTime Github.Interface.Comment 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) {-| Check if this comment was created via an email reply. -} createdViaEmail : Field Bool Github.Interface.Comment createdViaEmail = Object.fieldDecoder "createdViaEmail" [] Decode.bool {-| The actor who edited the comment. -} editor : SelectionSet decodesTo Github.Interface.Actor -> Field (Maybe decodesTo) Github.Interface.Comment editor object_ = Object.selectionField "editor" [] object_ (identity >> Decode.nullable) id : Field Github.Scalar.Id Github.Interface.Comment 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) {-| The moment the editor made the last edit -} lastEditedAt : Field (Maybe Github.Scalar.DateTime) Github.Interface.Comment lastEditedAt = Object.fieldDecoder "lastEditedAt" [] (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) {-| Identifies when the comment was published at. -} publishedAt : Field (Maybe Github.Scalar.DateTime) Github.Interface.Comment publishedAt = Object.fieldDecoder "publishedAt" [] (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) {-| Identifies the date and time when the object was last updated. -} updatedAt : Field Github.Scalar.DateTime Github.Interface.Comment 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) type alias UserContentEditsOptionalArguments = { first : OptionalArgument Int, after : OptionalArgument String, last : OptionalArgument Int, before : OptionalArgument String } {-| A list of edits to this content. - 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. -} userContentEdits : (UserContentEditsOptionalArguments -> UserContentEditsOptionalArguments) -> SelectionSet decodesTo Github.Object.UserContentEditConnection -> Field (Maybe decodesTo) Github.Interface.Comment userContentEdits 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 "userContentEdits" optionalArgs object_ (identity >> Decode.nullable) {-| Did the viewer author this comment. -} viewerDidAuthor : Field Bool Github.Interface.Comment viewerDidAuthor = Object.fieldDecoder "viewerDidAuthor" [] Decode.bool