[{"name":"GraphQL.Decode","comment":"\n\n@docs Decoder\n\n\n## **Learning and troubleshooting**\n\nWhen I first got started with JSON decoders, I had a hard time visualizing what was going on.\nFor that reason, this module comes with a [`test`](#test) function to help you\neasily verify your code is behaving the way you expect.\n\nThis is inspired by the `elm/json` package's [`decodeString`](https://package.elm-lang.org/packages/elm/json/latest/Json-Decode#decodeString)\nfunction, which is great for testing JSON decoders when you get stuck!\n\n@docs test\n\n\n## **Scalars**\n\nIn GraphQL, [scalars](https://graphql.org/learn/schema/#scalar-types) are strings, numbers,\nIDs, and other basic primitives that your API can send. For the five built-in scalars, these functions are provided below.\n\nSee the [`scalar`](#scalar) function to work with custom scalars specific to your API.\n\n@docs string, float, int, bool, id\n@docs scalar\n\n\n## **Enums**\n\n@docs enum\n\n\n## **Objects**\n\n@docs object, field\n\n\n### **Lists & Nullable Fields**\n\n@docs maybe, list\n\n\n## **Interfaces & Union Types**\n\n\n### **❗️ Always include \\_\\_typename**\n\nInterfaces and union type decoders require the `__typename` field in the selection. Without it,\nElm won't be able to match on the typename provided.\n\nHere's an example from the official GraphQL documentation:\n\n```graphql\n{\n  search(text: \"an\") {\n    __typename\n    ... on Human {\n      name\n      height\n    }\n    ... on Droid {\n      name\n      primaryFunction\n    }\n    ... on Starship {\n      name\n      length\n    }\n  }\n}\n```\n\nBecause the `hero` query returns an `interface`, you should always include `__typename` in your selection set.\nThis will allow your Elm frontend to know which types came back:\n\n```json\n{\n  \"data\": {\n    \"search\": [\n      {\n        \"__typename\": \"Human\",\n        \"name\": \"Han Solo\",\n        \"height\": 1.8\n      },\n      {\n        \"__typename\": \"Human\",\n        \"name\": \"Leia Organa\",\n        \"height\": 1.5\n      },\n      {\n        \"__typename\": \"Starship\",\n        \"name\": \"TIE Advanced x1\",\n        \"length\": 9.2\n      }\n    ]\n  }\n}\n```\n\n@docs union, interface\n@docs Variant, variant\n\n\n## **Internals**\n\nThese functions are used internally by GraphQL.Http, and you won't need them in your projects.\n\n@docs map\n@docs toJsonDecoder\n\n","unions":[{"name":"Decoder","comment":" When you make a GraphQL request, you'll get a JSON response like this one:\n\n```json\n{\n  \"data\": {\n    \"hero\": {\n      \"name\": \"R2-D2\",\n      \"appearsIn\": [\n        \"NEWHOPE\",\n        \"EMPIRE\",\n        \"JEDI\"\n      ]\n    }\n  }\n}\n```\n\nThis `Decoder` type represents a value that knows how to convert a raw JSON response into standard Elm values that can be used in your Elm application.\n\n","args":["value"],"cases":[]},{"name":"Variant","comment":" A type that represents a custom type variant on a union type or interface. These are used with\n[`union`](#union) or [`interface`](#interface) in the examples above.\n","args":["value"],"cases":[]}],"aliases":[],"values":[{"name":"bool","comment":" A decoder for the built-in `Boolean` scalar.\n\n    import GraphQL.Decode\n\n    GraphQL.Decode.test\n        { decoder = GraphQL.Decode.bool\n        , json = \"\"\" true \"\"\"\n        }\n        == Ok True\n\n","type":"GraphQL.Decode.Decoder Basics.Bool"},{"name":"enum","comment":" A decoder for handling [enum values](https://graphql.org/learn/schema/#enumeration-types). It allows you to specify a list of allowed enums that can\ncome back with a certain request.\n\nTo prevent code duplication, we recommend defining one `decoder` for each enum in a separate Elm module,\nlike `GraphQL.Enum.Episode`. Here's how you can use this function to define a decoder for\nthe `Episode` enum type:\n\n    import GraphQL.Decode exposing (Decoder)\n\n    type Episode\n        = NewHope\n        | EmpireStrikesBack\n        | ReturnOfTheJedi\n\n    decoder : Decoder Episode\n    decoder =\n        GraphQL.Decode.enum\n            [ ( \"NEWHOPE\", NewHope )\n            , ( \"EMPIRE\", EmpireStrikesBack )\n            , ( \"RETURN\", ReturnOfTheJedi )\n            ]\n\n**Note:** If an enum is missing from that list, this package will return a\nJSON decoding error letting you know which enum variant was missing.\n\n","type":"List.List ( String.String, enum ) -> GraphQL.Decode.Decoder enum"},{"name":"field","comment":" When used with [`object`](#object), this function allows you to\nadd fields to an object.\n\n**Note:** The order of the fields in the `type alias` need to match\nthe order you add the fields in your decoder.\n\n    import GraphQL.Decode exposing (Decoder)\n    import GraphQL.Enum.Episode\n\n    type alias Jedi =\n        { name : String\n        , appearsIn : List GraphQL.Enum.Episode\n        }\n\n    decoder : Decoder Person\n    decoder =\n        GraphQL.Decode.object Person\n            |> GraphQL.Decode.field\n                { name = \"name\"\n                , decoder = GraphQL.Decode.string\n                }\n            |> GraphQL.Decode.field\n                { name = \"appearsIn\"\n                , decoder =\n                    GraphQL.Decode.list\n                        GraphQL.Enum.Episode.decoder\n                }\n\n","type":"{ name : String.String, decoder : GraphQL.Decode.Decoder field } -> GraphQL.Decode.Decoder (field -> output) -> GraphQL.Decode.Decoder output"},{"name":"float","comment":" A decoder for the built-in `Float` scalar.\n\n    import GraphQL.Decode\n\n    GraphQL.Decode.test\n        { decoder = GraphQL.Decode.float\n        , json = \"\"\" 1.25 \"\"\"\n        }\n        == Ok 1.25\n\n","type":"GraphQL.Decode.Decoder Basics.Float"},{"name":"id","comment":" A decoder for the built-in `ID` scalar.\n\nUses [GraphQL.Scalar.Id](./GraphQL-Scalar-Id) as a way to prevent\nmixing up `String` and `Id` values.\n\n    import GraphQL.Decode\n\n    -- Works with JSON strings\n    GraphQL.Decode.test\n        { decoder = GraphQL.Decode.id\n        , json = \"\"\" \"abc\" \"\"\"\n        }\n        == Ok (Id \"abc\")\n\n    -- Works with JSON numbers\n    test\n        { decoder = id\n        , json = \"\"\" 12345 \"\"\"\n        }\n        == Ok (Id \"12345\")\n\n","type":"GraphQL.Decode.Decoder GraphQL.Scalar.Id.Id"},{"name":"int","comment":" A decoder for the built-in `Int` scalar.\n\n    import GraphQL.Decode\n\n    GraphQL.Decode.test\n        { decoder = GraphQL.Decode.int\n        , json = \"\"\" 9000 \"\"\"\n        }\n        == Ok 9000\n\n","type":"GraphQL.Decode.Decoder Basics.Int"},{"name":"interface","comment":" Decoder for [interfaces](https://graphql.org/learn/schema/#interfaces) that allow you to select extra fields. This works alongside the [`variant`](#variant)\nfunction to define which variants you are interested in tracking.\n\n    import GraphQL.Decode exposing (Decoder)\n\n    type HeroInterface\n        = On_Human Human\n        | On_Droid Droid\n\n    decoder : Decoder SearchUnion\n    decoder =\n        GraphQL.Decode.interface\n            [ GraphQL.Decode.variant\n                { typename = \"Human\"\n                , onVariant = On_Human\n                , decoder = humanDecoder\n                }\n            , GraphQL.Decode.variant\n                { typename = \"Droid\"\n                , onVariant = On_Droid\n                , decoder = droidDecoder\n                }\n            ]\n\nYou can see the [`union`](#union) example to understand how to\nmake `humanDecoder` or `droidDecoder`. Their implementations are identical!\n\n❗️ [See the important note about using `__typename`](#-always-include-_-_typename-) to prevent issues\n\n","type":"List.List (GraphQL.Decode.Variant interface) -> GraphQL.Decode.Decoder interface"},{"name":"list","comment":" Use this function to tell an existing decoder that we expect a list of values,\nrather than a single value:\n\n    import GraphQL.Decode exposing (Decoder)\n\n    stringDecoder : Decoder String\n    stringDecoder =\n        GraphQL.Decoder.string\n\n    listOfStringDecoder : Decoder (List String)\n    listOfStringDecoder =\n        GraphQL.Decoder.list GraphQL.Decoder.string\n\n","type":"GraphQL.Decode.Decoder value -> GraphQL.Decode.Decoder (List.List value)"},{"name":"map","comment":" Map a decoder of one value to another.\n","type":"(a -> b) -> GraphQL.Decode.Decoder a -> GraphQL.Decode.Decoder b"},{"name":"maybe","comment":" Use this function to tell an existing decoder that we expect a nullable value,\nwhich might not guaranteed to be available:\n\n    import GraphQL.Decode exposing (Decoder)\n\n    stringDecoder : Decoder String\n    stringDecoder =\n        GraphQL.Decoder.string\n\n    nullableStringDecoder : Decoder (Maybe String)\n    nullableStringDecoder =\n        GraphQL.Decoder.maybe GraphQL.Decoder.string\n\n","type":"GraphQL.Decode.Decoder value -> GraphQL.Decode.Decoder (Maybe.Maybe value)"},{"name":"object","comment":" A decoder for working with [object types](https://graphql.org/learn/schema/#object-types-and-fields).\nThis function works in conjunction with [`field`](#field) to allow you to safely decode one field at a time.\n\n    import GraphQL.Decode exposing (Decoder)\n\n    type alias Person =\n        { id : Id\n        , fullName : String\n        }\n\n    decoder : Decoder Person\n    decoder =\n        GraphQL.Decode.object Person\n            |> GraphQL.Decode.field\n                { name = \"id\"\n                , decoder = GraphQL.Decode.id\n                }\n            |> GraphQL.Decode.field\n                { name = \"fullName\"\n                , decoder = GraphQL.Decode.string\n                }\n\n","type":"(field -> object) -> GraphQL.Decode.Decoder (field -> object)"},{"name":"scalar","comment":" GraphQL allows APIs to define custom scalar values, like `Date` or `Currency`. This function\nallows you to work with those custom values.\n\nHere's an example of using this function to work with a `DateTime` type. We recommend defining each custom scalar\nin a separate Elm module, like `GraphQL.Scalar.DateTime`:\n\n    -- module GraphQL.Scalar.DateTime exposing\n    --     ( DateTime\n    --     , decoder, encode\n    --     )\n\n\n    import GraphQL.Decode exposing (Decoder)\n    import Iso8601\n    import Time\n\n    type alias DateTime =\n        Time.Posix\n\n    decoder : Decoder DateTime\n    decoder =\n        GraphQL.Decode.scalar Iso8601.decoder\n\nThe snippet above uses [`elm/time`](https://package.elm-lang.org/packages/elm/time) and [`rtfeldman/elm-iso8601-date-strings`](https://package.elm-lang.org/packages/rtfeldman/elm-iso8601-date-strings/latest/Iso8601)\nto convert a `String` value from our API into a `Time.Posix` value.\n\n    import GraphQL.Decode\n    import GraphQL.Scalar.DateTime\n\n    GraphQL.Decode.test\n        { decoder = GraphQL.Scalar.DateTime.decoder\n        , value = \"\"\" \"2022-12-26T01:45:56.520Z\" \"\"\"\n        }\n        == Ok (Posix 1672019156520)\n\n","type":"Json.Decode.Decoder scalar -> GraphQL.Decode.Decoder scalar"},{"name":"string","comment":" A decoder for the built-in `String` scalar.\n\n    import GraphQL.Decode\n\n    GraphQL.Decode.test\n        { decoder = GraphQL.Decode.string\n        , json = \"\"\" \"Hello, world!\" \"\"\"\n        }\n        == Ok \"Hello, world!\"\n\n","type":"GraphQL.Decode.Decoder String.String"},{"name":"test","comment":" This function is exposed so you can quickly check if your GraphQL `Decoder` works as you expect\nwith a raw JSON string.\n\n    import GraphQL.Decode\n\n    testResult : Result Http.Error Int\n    testResult =\n        GraphQL.Decode.test\n            { decoder = GraphQL.Decode.int\n            , json = \"\"\" 1000 \"\"\"\"\n            }\n\n","type":"{ decoder : GraphQL.Decode.Decoder value, json : String.String } -> Result.Result Json.Decode.Error value"},{"name":"toJsonDecoder","comment":" ","type":"GraphQL.Decode.Decoder value -> Json.Decode.Decoder value"},{"name":"union","comment":" Decoder for a [union type](https://graphql.org/learn/schema/#union-types). Use this with the [`variant`](#variant) function to select variants by typename:\n\n    import GraphQL.Decode exposing (Decoder)\n\n    type SearchUnion\n        = On_Human Human\n        | On_Droid Droid\n        | On_Starship Starship\n\n    decoder : Decoder SearchUnion\n    decoder =\n        GraphQL.Decode.union\n            [ GraphQL.Decode.variant\n                { typename = \"Human\"\n                , onVariant = On_Human\n                , decoder = humanDecoder\n                }\n            , GraphQL.Decode.variant\n                { typename = \"Droid\"\n                , onVariant = On_Droid\n                , decoder = droidDecoder\n                }\n            , GraphQL.Decode.variant\n                { typename = \"Starship\"\n                , onVariant = On_Starship\n                , decoder = starshipDecoder\n                }\n            ]\n\nEach variant will expect a decoder for the data you expect. This will involve using\nthe [`object`](#object) and [`field`](#field) functions in this module:\n\n    type alias Human =\n        { name : String\n        , height : Int\n        }\n\n    humanDecoder : Decoder Human\n    humanDecoder =\n        GraphQL.Decode.object Human\n            |> GraphQL.Decode.field\n                { name = \"name\"\n                , decoder = GraphQL.Decode.string\n                }\n            |> GraphQL.Decode.field\n                { name = \"height\"\n                , decoder = GraphQL.Decode.int\n                }\n\n    type alias Droid =\n        { name : String\n        , primaryFunction : String\n        }\n\n    droidDecoder : Decoder Droid\n    droidDecoder =\n        GraphQL.Decode.object Droid\n            |> GraphQL.Decode.field\n                { name = \"name\"\n                , decoder = GraphQL.Decode.string\n                }\n            |> GraphQL.Decode.field\n                { name = \"primaryFunction\"\n                , decoder = GraphQL.Decode.string\n                }\n\n    type alias Starship =\n        { name : String\n        , length : Int\n        }\n\n    starshipDecoder : Decoder Starship\n    starshipDecoder =\n        GraphQL.Decode.object Starship\n            |> GraphQL.Decode.field\n                { name = \"name\"\n                , decoder = GraphQL.Decode.string\n                }\n            |> GraphQL.Decode.field\n                { name = \"length\"\n                , decoder = GraphQL.Decode.int\n                }\n\n❗️ [See the important note about using `__typename`](#-always-include-_-_typename-) to prevent issues\n\n","type":"List.List (GraphQL.Decode.Variant union) -> GraphQL.Decode.Decoder union"},{"name":"variant","comment":" A function intended to be used with [`union`](#union) or [`interface`](#interface) for\nselecting specific custom type variants by typename.\n\n    import GraphQL.Decode exposing (Variant)\n\n    type HeroInterface\n        = On_Human Human\n        | On_Droid Droid\n\n    humanVariant : Variant HeroInterface\n    humanVariant =\n        GraphQL.Decode.variant\n            { typename = \"Human\"\n            , onVariant = On_Human\n            , decoder = humanDecoder\n            }\n\n    droidVariant : Variant HeroInterface\n    droidVariant =\n        GraphQL.Decode.variant\n            { typename = \"Droid\"\n            , onVariant = On_Droid\n            , decoder = droidDecoder\n            }\n\n","type":"{ typename : String.String, onVariant : object -> value, decoder : GraphQL.Decode.Decoder object } -> GraphQL.Decode.Variant value"}],"binops":[]},{"name":"GraphQL.Encode","comment":"\n\n@docs Value\n\n\n## **Scalars**\n\n@docs string, float, int, bool, id\n@docs scalar\n\n\n## **Enums**\n\n@docs enum\n\n\n## **Input types**\n\n@docs input\n\n\n## **Advanced**\n\n@docs list, maybe, null\n\n\n## **Internals**\n\nThese functions are used internally by [`GraphQL.Http`](./GraphQL-Http), and you won't need them in your projects\n\n@docs toJson\n\n","unions":[{"name":"Value","comment":" The `Value` type represents a JSON value that will be sent to your GraphQL API.\nWhen you use this with the [`GraphQL.Http`](./GraphQL-Http) module, this is an example\nof what will be sent with your HTTP request:\n\n```json\n{\n    \"variables\": {\n        \"id\": \"123\",\n        \"form\": {\n            \"email\": \"ryan@elm.land\",\n            \"password\": \"secret123\"\n        }\n    }\n}\n```\n\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"bool","comment":" Create a GraphQL input from a `Bool` value:\n\n    import GraphQL.Encode\n\n    isReadingThis : GraphQL.Encode.Value\n    isReadingThis =\n        GraphQL.Encode.bool True\n\n","type":"Basics.Bool -> GraphQL.Encode.Value"},{"name":"enum","comment":" Create a GraphQL input from an enum value. To avoid duplicating code, we recommend\nyou create a separate Elm module per enum, like `GraphQL.Enum.Episode`.\n\nIn that module, you can define your `encode` function in one place:\n\n    -- module GraphQL.Enum.Episode exposing\n    --     ( Episode(..), list\n    --     , decoder, encode\n    --     )\n\n\n    import GraphQL.Encode\n\n    type Episode\n        = NewHope\n        | EmpireStrikesBack\n        | ReturnOfTheJedi\n\n    encode : Episode -> GraphQL.Encode.Value\n    encode episode =\n        GraphQL.Encode.enum\n            { toString = toString\n            , value = episode\n            }\n\n    toString : Episode -> String\n    toString episode =\n        case episode of\n            NewHope ->\n                \"NEWHOPE\"\n\n            EmpireStrikesBack ->\n                \"EMPIRE\"\n\n            ReturnOfTheJedi ->\n                \"RETURN\"\n\n","type":"{ toString : enum -> String.String, value : enum } -> GraphQL.Encode.Value"},{"name":"float","comment":" Create a GraphQL input from a `Float` value:\n\n    import GraphQL.Encode\n\n    score : GraphQL.Encode.Value\n    score =\n        GraphQL.Encode.float 0.99\n\n","type":"Basics.Float -> GraphQL.Encode.Value"},{"name":"id","comment":" Create a GraphQL input from a `Id` value:\n\n    import GraphQL.Encode\n    import GraphQL.Scalar.Id exposing (Id)\n\n    userId : Id\n    userId =\n        GraphQL.Scalar.Id.fromInt 1203\n\n    isReadingThis : GraphQL.Encode.Value\n    isReadingThis =\n        GraphQL.Encode.id userId\n\n","type":"GraphQL.Scalar.Id.Id -> GraphQL.Encode.Value"},{"name":"input","comment":" GraphQL allows the API to define [input types](https://graphql.org/learn/schema/#input-types). These allow you to group\nyour inputs into an object, like this:\n\n    import GraphQL.Encode\n\n    reviewInputValue : GraphQL.Encode.Value\n    reviewInputValue =\n        GraphQL.Encode.input\n            [ ( \"stars\"\n              , GraphQL.Encode.int 10\n              )\n            , ( \"commentary\"\n              , GraphQL.Encode.int \"Would eat again!\"\n              )\n            ]\n\n","type":"List.List ( String.String, GraphQL.Encode.Value ) -> GraphQL.Encode.Value"},{"name":"int","comment":" Create a GraphQL input from a `Int` value:\n\n    import GraphQL.Encode\n\n    age : GraphQL.Encode.Value\n    age =\n        GraphQL.Encode.int 62\n\n","type":"Basics.Int -> GraphQL.Encode.Value"},{"name":"list","comment":" Create a value from a list:\n\n    import GraphQL.Encode\n\n    encodeIds : List Int -> GraphQL.Encode.Value\n    encodeIds ids =\n        GraphQL.Encode.list GraphQL.Encode.int ids\n\n\n    encodeIds [] == \"\"\" [] \"\"\"\n    encodeIds [1,2,3] == \"\"\" [1,2,3] \"\"\"\n\n","type":"(a -> GraphQL.Encode.Value) -> List.List a -> GraphQL.Encode.Value"},{"name":"maybe","comment":" Create a `Maybe` value, using `null` if there is no value provided:\n\n    import GraphQL.Encode\n\n    encodeEmail : Maybe String -> GraphQL.Encode.Value\n    encodeEmail email =\n        GraphQL.Encode.maybe GraphQL.Encode.string email\n\n\n    encodeEmail Nothing == \"\"\" null \"\"\"\n    encodeEmail (Just \"ryan@elm.land\") == \"\"\" \"ryan@elm.land\" \"\"\"\n\n","type":"(a -> GraphQL.Encode.Value) -> Maybe.Maybe a -> GraphQL.Encode.Value"},{"name":"null","comment":" Send a `null` value to a GraphQL API. This is commonly used by mutations\nto mark a field as removed.\n\n    import GraphQL.Encode\n\n    profileInputValue : GraphQL.Encode.Value\n    profileInputValue =\n        GraphQL.Encode.input\n            [ ( \"name\"\n              , GraphQL.Encode.string \"Ryan\"\n              )\n            , ( \"bio\"\n              , GraphQL.Encode.null\n              )\n            ]\n\n","type":"GraphQL.Encode.Value"},{"name":"scalar","comment":" Here's an example of using this function to work with a `DateTime` type. We recommend defining each custom scalar\nin a separate Elm module, like `GraphQL.Scalar.DateTime`:\n\n    -- module GraphQL.Scalar.DateTime exposing\n    --     ( DateTime\n    --     , decoder, encode\n    --     )\n\n\n    import GraphQL.Encode\n    import Iso8601\n    import Time\n\n    type alias DateTime =\n        Time.Posix\n\n    encode : DateTime -> GraphQL.Encode.Value\n    encode dateTime =\n        GraphQL.Encode.scalar\n            { toJson = Iso8601.encode\n            , value = dateTime\n            }\n\nThe snippet above uses [`elm/time`](https://package.elm-lang.org/packages/elm/time) and [`rtfeldman/elm-iso8601-date-strings`](https://package.elm-lang.org/packages/rtfeldman/elm-iso8601-date-strings/latest/Iso8601)\nto convert our `Time.Posix` value into an ISO 8601 `String` value for our API.\n\n    import GraphQL.Scalar.DateTime\n\n    GraphQL.Scalar.DateTime.encode\n        (Time.millisToPosix 1672019156520)\n        == Json \"2022-12-26T01:45:56.520Z\"\n\n","type":"{ toJson : scalar -> Json.Encode.Value, value : scalar } -> GraphQL.Encode.Value"},{"name":"string","comment":" Create a GraphQL input from a `String` value:\n\n    import GraphQL.Encode\n\n    name : GraphQL.Encode.Value\n    name =\n        GraphQL.Encode.string \"Ryan\"\n\n","type":"String.String -> GraphQL.Encode.Value"},{"name":"toJson","comment":" ","type":"GraphQL.Encode.Value -> Json.Encode.Value"}],"binops":[]},{"name":"GraphQL.Error","comment":" Your GraphQL API might return a [validation](https://graphql.org/learn/validation/) response like this one:\n\n```json\n{\n  \"errors\": [\n    {\n      \"message\": \"Cannot query field \\\"nam\\\" on type \\\"Droid\\\".\",\n      \"locations\": [\n        {\n          \"line\": 4,\n          \"column\": 5\n        }\n      ]\n    }\n  ]\n}\n```\n\nThis module defines the GraphQL \"error\" type, to help parse any validation issues within your Elm application.\n\n\n## **Error**\n\n@docs Error\n@docs Location, PathSegment\n\n\n## **Partial errors**\n\nIt's also possible for your GraphQL response to return **partial errors**, meaning that\nboth the `data` fields _and_ the _errors_ field could come back in the same response.\n\nIf your application would like to access those partial errors, use either of these two functions:\n\n  - [`GraphQL.Http.expectWithPartialErrors`](./GraphQL-Http#expectWithPartialErrors)\n  - [`GraphQL.Operation.toHttpCmdWithPartialErrors`](./GraphQL-Operation#toHttpCmdWithPartialErrors)\n\n**Note:** This will make your `Msg` result values more complicated:\n\n```elm\n-- 1️⃣ BEFORE\n\ntype Msg\n    = ApiResponded (Result GraphQL.Http.Error Data)\n\n\n-- 2️⃣ AFTER\n\ntype Msg\n    = ApiResponded\n        (Result GraphQL.Http.Error\n            { data : Data\n            , errors : List Error\n            }\n        )\n```\n\n","unions":[{"name":"PathSegment","comment":" Helps identify which field might be causing problems\n","args":[],"cases":[["Index",["Basics.Int"]],["Field",["String.String"]]]}],"aliases":[{"name":"Error","comment":" A validation error returned by your GraphQL API.\n","args":[],"type":"{ message : String.String, locations : List.List GraphQL.Error.Location, path : List.List GraphQL.Error.PathSegment, extensions : Dict.Dict String.String Json.Decode.Value }"},{"name":"Location","comment":" Represents a location in your query/mutation\n","args":[],"type":"{ line : Basics.Int, column : Basics.Int }"}],"values":[],"binops":[]},{"name":"GraphQL.Http","comment":"\n\n\n## **HTTP requests**\n\n@docs get, post\n\n\n## **Errors**\n\n@docs Error\n\n\n## **Advanced usage with `elm/http`**\n\nThe two functions below are helpful for more advanced applications using functions like [`Http.request`](https://package.elm-lang.org/packages/elm/http/latest/Http#request).\n\nUse these if you need to send HTTP headers, define request timeouts, etc.\n\n    import GraphQL.Http\n    import Http\n\n    fetchCurrentUser : Cmd Msg\n    fetchCurrentUser =\n        Http.request\n            { method = \"POST\"\n            , url = \"/api/graphql\"\n            , headers = []\n            , body =\n                GraphQL.Http.body\n                    { operationName = Just \"FetchCurrentUser\"\n                    , query = \"\"\"\n                        query FetchCurrentUser {\n                            me {\n                                id\n                                name\n                            }\n                        }\n                    \"\"\"\n                    , variables = []\n                    }\n            , expect =\n                GraphQL.Http.expect\n                    FetchCurrentUserApiResponded\n                    decoder\n            , tracker = Nothing\n            , timeout = Nothing\n            }\n\n@docs body, expect\n\n\n## **Partial errors**\n\n@docs expectWithPartialErrors\n\n","unions":[{"name":"Error","comment":" When something goes wrong with the GraphQL request, this error type\nwill be returned with your `Result`.\n\nThis extends the default `Http.Error` to include more context and\nGraphQL specific errors returned from the API.\n\n","args":[],"cases":[["BadUrl",["String.String"]],["Timeout",[]],["NetworkError",[]],["GraphQL",["{ errors : List.List GraphQL.Error.Error }"]],["UnexpectedResponse",["{ url : String.String, statusCode : Basics.Int, statusText : String.String, headers : Dict.Dict String.String String.String, body : String.String, jsonError : Maybe.Maybe Json.Decode.Error }"]]]}],"aliases":[],"values":[{"name":"body","comment":" Create the JSON body for your GraphQL request.\n\n    GraphQL.Http.body\n        { operationName = Just \"FetchCurrentUser\"\n        , query = \"\"\"\n            query FetchCurrentUser {\n                me {\n                    id\n                    name\n                }\n            }\n        \"\"\"\n        , variables = []\n        }\n\n","type":"{ operationName : Maybe.Maybe String.String, query : String.String, variables : List.List ( String.String, GraphQL.Encode.Value ) } -> Http.Body"},{"name":"expect","comment":" Expect a JSON response from a GraphQL API.\n\n    type Msg\n        = ApiResponded (Result GraphQL.Http.Error Data)\n\n    fetchData : Cmd Msg\n    fetchData =\n        Http.request\n            { -- ... other fields\n            , expect =\n                GraphQL.Http.expect\n                    ApiResponded\n                    decoder\n            }\n\n","type":"(Result.Result GraphQL.Http.Error data -> msg) -> GraphQL.Decode.Decoder data -> Http.Expect msg"},{"name":"expectWithPartialErrors","comment":" According to the [GraphQL specification](https://spec.graphql.org/June2018/#example-08b62), it's possible to\nreceive GraphQL errors alongside a valid data response:\n\n```json\n{\n  \"errors\": [\n    {\n      \"message\": \"Name for character with ID 1002 could not be fetched.\",\n      \"locations\": [ { \"line\": 6, \"column\": 7 } ],\n      \"path\": [ \"hero\", \"heroFriends\", 1, \"name\" ]\n    }\n  ],\n  \"data\": {\n    \"hero\": {\n      \"name\": \"R2-D2\",\n      \"heroFriends\": [\n        {\n          \"id\": \"1000\",\n          \"name\": \"Luke Skywalker\"\n        },\n        null,\n        {\n          \"id\": \"1003\",\n          \"name\": \"Leia Organa\"\n        }\n      ]\n    }\n  }\n}\n```\n\nIf your application needs to access those partial error responses,\nuse this rather than the simpler `expect` function:\n\n    type Msg\n        = ApiResponded\n            (Result GraphQL.Http.Error\n                { data : Data\n                , errors : List GraphQL.Error.Error\n                }\n            )\n\n    fetchData : Cmd Msg\n    fetchData =\n        Http.request\n            { -- ... other fields\n            , expect =\n                GraphQL.Http.expectWithPartialErrors\n                    ApiResponded\n                    decoder\n            }\n\n","type":"(Result.Result GraphQL.Http.Error { data : data, errors : List.List GraphQL.Error.Error } -> msg) -> GraphQL.Decode.Decoder data -> Http.Expect msg"},{"name":"get","comment":" Send an HTTP `GET` request to your GraphQL API\n\n    GraphQL.Http.get\n        { url = \"/api/graphql\"\n        , query = \"\"\"\n            query FindPerson(name: $name) {\n                person(name: $name) {\n                    id\n                    name\n                }\n            }\n        \"\"\"\n        , variables =\n            [ ( \"name\", GraphQL.Encode.string \"Doug\" )\n            ]\n        , onResponse = ApiResponded\n        , decoder = decoder\n        }\n\n","type":"{ url : String.String, query : String.String, variables : List.List ( String.String, GraphQL.Encode.Value ), decoder : GraphQL.Decode.Decoder data, onResponse : Result.Result GraphQL.Http.Error data -> msg } -> Platform.Cmd.Cmd msg"},{"name":"post","comment":" Send an HTTP `POST` request to your GraphQL API\n\n    GraphQL.Http.post\n        { url = \"/api/graphql\"\n        , query = \"\"\"\n            query FindPerson(name: $name) {\n                person(name: $name) {\n                    id\n                    name\n                }\n            }\n        \"\"\"\n        , variables =\n            [ ( \"name\", GraphQL.Encode.string \"Doug\" )\n            ]\n        , onResponse = ApiResponded\n        , decoder = decoder\n        }\n\n","type":"{ url : String.String, query : String.String, variables : List.List ( String.String, GraphQL.Encode.Value ), decoder : GraphQL.Decode.Decoder data, onResponse : Result.Result GraphQL.Http.Error data -> msg } -> Platform.Cmd.Cmd msg"}],"binops":[]},{"name":"GraphQL.Operation","comment":" In GraphQL, an \"operation\" represents a query or mutation.\n\n( If you're just getting started to this package, I'd ignore this and try `GraphQL.Http` instead! )\n\nThis module exposes functions to make it easier to set up error reporting for\nall GraphQL requests in one place. Rather than executing `Cmd` values directly\nfrom the `GraphQL.Http` package, you can describe your GraphQL operations as data, and\nhandle the actual HTTP stuff in one place.\n\nThis makes it easier to work with user tokens, environment specific URLs, without needing to\npass that context through for each page that uses GraphQL.\n\n@docs Operation, new\n@docs map\n@docs toHttpCmd\n\n\n## **Partial errors**\n\n@docs toHttpCmdWithPartialErrors\n\n","unions":[{"name":"Operation","comment":" An operation represents a GraphQL query or mutation.\n","args":["data"],"cases":[]}],"aliases":[],"values":[{"name":"map","comment":" Convert an operation from one type variable to another. This is especially useful when using the `Effect msg` type in\nan [Elm Land](https://elm.land) application. (Although the effect pattern can be used without the Elm Land framework!)\n\nThe `map` function allows us to eliminate that extra `data` type variable, so we can still use `Effect msg` as expected:\n\n    type Effect msg\n        = -- ...\n        | SendGraphQL\n            { operation : GraphQL.Operation.Operation msg\n            , onError : GraphQL.Http.Error -> msg\n            }\n\n    sendGraphQL :\n        { operation : Operation data\n        , onResponse : Result GraphQL.Http.Error data -> msg\n        }\n        -> Effect msg\n    sendGraphQL props =\n        let\n            operation : Operation msg\n            operation =\n                GraphQL.Operation.map\n                    (\\data -> props.onResponse (Ok data))\n                    props.operation\n        in\n        SendGraphQL\n            { operation = operation\n            , onError = \\httpError -> props.onResponse (Err httpError)\n            }\n\n","type":"(a -> b) -> GraphQL.Operation.Operation a -> GraphQL.Operation.Operation b"},{"name":"new","comment":" Create a new operation:\n\n    operation : Operation Data\n    operation =\n        GraphQL.Operation.new\n            { name = \"FetchRepos\"\n            , query = \"\"\"\n                query FetchRepos($first: Int!) {\n                  repos(first: $first) {\n                    id\n                    name\n                    owner\n                  }\n                }\n            \"\"\"\n            , variables =\n                [ ( \"first\", GraphQL.Encode.int 25 )\n                ]\n            , decoder =\n                GraphQL.Decode.object Data\n                    |> GraphQL.Decode.field\n                        { name = \"repos\"\n                        , decoder = ...\n                        }\n            }\n\n","type":"{ name : String.String, query : String.String, variables : List.List ( String.String, GraphQL.Encode.Value ), decoder : GraphQL.Decode.Decoder data } -> GraphQL.Operation.Operation data"},{"name":"toHttpCmd","comment":" Send an HTTP request with the GraphQL operation. Below is an example of how you\ncan use it with [Elm Land's](https://elm.land) `Effect` module to ensure all\nGraphQL HTTP errors are reported automatically:\n\n    type Effect msg\n        = -- ...\n        | SendGraphQL\n            { operation : GraphQL.Operation.Operation msg\n            , onError : GraphQL.Http.Error -> msg\n            }\n\n    toCmd :\n        { options\n            | effect : Effect msg\n            , fromSharedMsg : Shared.Msg -> msg\n            , batch : List msg -> msg\n        }\n        -> Cmd msg\n    toCmd options =\n        case options.effect of\n\n            -- ...\n\n            SendGraphQL { operation, onError } ->\n                GraphQL.Operation.toHttpCmd\n                    { method = \"POST\"\n                    , url = \"https://api.github.com/graphql\"\n                    , headers =\n                        [ Http.header \"Authorization\" \"Bearer {...}\"\n                        ]\n                    , timeout = Just 30000\n                    , tracker = Nothing\n                    , operation = operation\n                    , onResponse =\n                        \\result ->\n                            case result of\n                                Ok msg ->\n                                    msg\n\n                                Err httpError ->\n                                    options.batch\n                                        [ onError httpError\n                                        , Shared.Msg.ReportHttpError httpError\n                                            |> options.fromSharedMsg\n                                        ]\n                    }\n\n","type":"{ method : String.String, url : String.String, headers : List.List Http.Header, timeout : Maybe.Maybe Basics.Float, tracker : Maybe.Maybe String.String, operation : GraphQL.Operation.Operation data, onResponse : Result.Result GraphQL.Http.Error data -> msg } -> Platform.Cmd.Cmd msg"},{"name":"toHttpCmdWithPartialErrors","comment":" This is the same as `toHttpCmd`, but changes the type of `onResponse` to support [partial errors](./GraphQL-Error#-partial-errors-)\nwith successful GraphQL responses.\n\n    type Effect msg\n        = -- ...\n        | SendGraphQL\n            { operation : GraphQL.Operation.Operation msg\n            , onError : Http.Error -> msg\n            }\n\n","type":"{ method : String.String, url : String.String, headers : List.List Http.Header, timeout : Maybe.Maybe Basics.Float, tracker : Maybe.Maybe String.String, operation : GraphQL.Operation.Operation data, onResponse : Result.Result GraphQL.Http.Error { data : data, errors : List.List GraphQL.Error.Error } -> msg } -> Platform.Cmd.Cmd msg"}],"binops":[]}]