Skip to content

Commit

Permalink
Merge pull request #15 from VladimirLogachev/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
serras committed Apr 28, 2023
2 parents 00e69c7 + c4198cb commit 61a113a
Show file tree
Hide file tree
Showing 20 changed files with 339 additions and 766 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/elm.yml
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v18
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v11
- uses: cachix/cachix-action@v12
with:
name: 47deg
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
Expand Down
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -15,7 +15,7 @@ $ cd backend && stack run library
And, in another terminal, this project:

```sh
$ cd frontend && yarn && yarn codegen && yarn start
$ cd frontend && npm install && npm run codegen codegen && npm start
```

## This example demonstrates how to use:
Expand Down Expand Up @@ -49,14 +49,13 @@ $ cd frontend && yarn && yarn codegen && yarn start
[preview]: library.png
[mu-haskell]: https://github.com/higherkindness/mu-haskell
[stack]: https://docs.haskellstack.org/en/stable/README/#how-to-install
[yarn]: https://yarnpkg.com/getting-started/install
[elm-graphql]: https://github.com/dillonkearns/elm-graphql/
[elm-live]: https://www.elm-live.com/

## Contributing:

You'll need a few things: [stack], [yarn] (npm) (and optionally, [Nix](https://nixos.org/)).
You'll need a few things: [stack], npm (and optionally, [Nix](https://nixos.org/)).

Run `nix-shell` the first time you clone the project, that way you'll have the generated `.pre-commit-config.yaml` git hook! 馃槈

When using Visual Studio Code, please prefer opening a pre-configured workspace file `workspace.code-workspace`.
When using Visual Studio Code, please prefer opening a pre-configured workspace file `mu-graphql-example-elm.code-workspace`.
3 changes: 0 additions & 3 deletions frontend/.gitignore
Expand Up @@ -16,6 +16,3 @@ package-lock.json

# Desktop Services Store on macOS
.DS_Store

# Elm-graphql generated code
src/LibraryApi
8 changes: 4 additions & 4 deletions frontend/elm.json
Expand Up @@ -6,7 +6,7 @@
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"dillonkearns/elm-graphql": "5.0.2",
"dillonkearns/elm-graphql": "5.0.11",
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0",
Expand All @@ -20,14 +20,14 @@
"elm/http": "2.0.0",
"elm/regex": "1.0.0",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2",
"elm-community/list-extra": "8.3.0",
"elm/virtual-dom": "1.0.3",
"j-maas/elm-ordered-containers": "1.0.0",
"lukewestby/elm-string-interpolate": "1.0.4"
}
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "1.2.2"
"elm-explorations/test": "2.1.1"
},
"indirect": {
"elm/random": "1.0.0"
Expand Down
4 changes: 1 addition & 3 deletions frontend/package.json
Expand Up @@ -8,10 +8,8 @@
},
"author": "higherkindness",
"license": "MIT",
"dependencies": {
"@dillonkearns/elm-graphql": "^4.2.1"
},
"devDependencies": {
"@dillonkearns/elm-graphql": "^4.2.1",
"elm-live": "^4.0.2"
}
}
73 changes: 73 additions & 0 deletions frontend/src/LibraryApi/InputObject.elm
@@ -0,0 +1,73 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.InputObject exposing (..)

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
import LibraryApi.Interface
import LibraryApi.Object
import LibraryApi.Scalar
import LibraryApi.ScalarCodecs
import LibraryApi.Union


buildNewAuthor :
NewAuthorRequiredFields
-> NewAuthor
buildNewAuthor required____ =
{ name = required____.name }


type alias NewAuthorRequiredFields =
{ name : String }


{-| Type for the NewAuthor input object.
-}
type alias NewAuthor =
{ name : String }


{-| Encode a NewAuthor into a value that can be used as an argument.
-}
encodeNewAuthor : NewAuthor -> Value
encodeNewAuthor input____ =
Encode.maybeObject
[ ( "name", Encode.string input____.name |> Just ) ]


buildNewBook :
NewBookRequiredFields
-> NewBook
buildNewBook required____ =
{ title = required____.title, authorId = required____.authorId, imageUrl = required____.imageUrl }


type alias NewBookRequiredFields =
{ title : String
, authorId : Int
, imageUrl : String
}


{-| Type for the NewBook input object.
-}
type alias NewBook =
{ title : String
, authorId : Int
, imageUrl : String
}


{-| Encode a NewBook into a value that can be used as an argument.
-}
encodeNewBook : NewBook -> Value
encodeNewBook input____ =
Encode.maybeObject
[ ( "title", Encode.string input____.title |> Just ), ( "authorId", Encode.int input____.authorId |> Just ), ( "imageUrl", Encode.string input____.imageUrl |> Just ) ]
10 changes: 10 additions & 0 deletions frontend/src/LibraryApi/Interface.elm
@@ -0,0 +1,10 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Interface exposing (..)


placeholder : String
placeholder =
""
43 changes: 43 additions & 0 deletions frontend/src/LibraryApi/Mutation.elm
@@ -0,0 +1,43 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Mutation exposing (..)

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 (SelectionSet)
import Json.Decode as Decode exposing (Decoder)
import LibraryApi.InputObject
import LibraryApi.Interface
import LibraryApi.Object
import LibraryApi.Scalar
import LibraryApi.ScalarCodecs
import LibraryApi.Union


type alias NewAuthorRequiredArguments =
{ author : LibraryApi.InputObject.NewAuthor }


newAuthor :
NewAuthorRequiredArguments
-> SelectionSet decodesTo LibraryApi.Object.Author
-> SelectionSet decodesTo RootMutation
newAuthor requiredArgs____ object____ =
Object.selectionForCompositeField "newAuthor" [ Argument.required "author" requiredArgs____.author LibraryApi.InputObject.encodeNewAuthor ] object____ Basics.identity


type alias NewBookRequiredArguments =
{ book : LibraryApi.InputObject.NewBook }


newBook :
NewBookRequiredArguments
-> SelectionSet decodesTo LibraryApi.Object.Book
-> SelectionSet decodesTo RootMutation
newBook requiredArgs____ object____ =
Object.selectionForCompositeField "newBook" [ Argument.required "book" requiredArgs____.book LibraryApi.InputObject.encodeNewBook ] object____ Basics.identity
13 changes: 13 additions & 0 deletions frontend/src/LibraryApi/Object.elm
@@ -0,0 +1,13 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Object exposing (..)


type Author
= Author


type Book
= Book
36 changes: 36 additions & 0 deletions frontend/src/LibraryApi/Object/Author.elm
@@ -0,0 +1,36 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Object.Author exposing (..)

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 (SelectionSet)
import Json.Decode as Decode
import LibraryApi.InputObject
import LibraryApi.Interface
import LibraryApi.Object
import LibraryApi.Scalar
import LibraryApi.ScalarCodecs
import LibraryApi.Union


id : SelectionSet Int LibraryApi.Object.Author
id =
Object.selectionForField "Int" "id" [] Decode.int


name : SelectionSet String LibraryApi.Object.Author
name =
Object.selectionForField "String" "name" [] Decode.string


books :
SelectionSet decodesTo LibraryApi.Object.Book
-> SelectionSet (List decodesTo) LibraryApi.Object.Author
books object____ =
Object.selectionForCompositeField "books" [] object____ (Basics.identity >> Decode.list)
41 changes: 41 additions & 0 deletions frontend/src/LibraryApi/Object/Book.elm
@@ -0,0 +1,41 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Object.Book exposing (..)

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 (SelectionSet)
import Json.Decode as Decode
import LibraryApi.InputObject
import LibraryApi.Interface
import LibraryApi.Object
import LibraryApi.Scalar
import LibraryApi.ScalarCodecs
import LibraryApi.Union


id : SelectionSet Int LibraryApi.Object.Book
id =
Object.selectionForField "Int" "id" [] Decode.int


title : SelectionSet String LibraryApi.Object.Book
title =
Object.selectionForField "String" "title" [] Decode.string


imageUrl : SelectionSet String LibraryApi.Object.Book
imageUrl =
Object.selectionForField "String" "imageUrl" [] Decode.string


author :
SelectionSet decodesTo LibraryApi.Object.Author
-> SelectionSet decodesTo LibraryApi.Object.Book
author object____ =
Object.selectionForCompositeField "author" [] object____ Basics.identity
43 changes: 43 additions & 0 deletions frontend/src/LibraryApi/Query.elm
@@ -0,0 +1,43 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Query exposing (..)

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 (SelectionSet)
import Json.Decode as Decode exposing (Decoder)
import LibraryApi.InputObject
import LibraryApi.Interface
import LibraryApi.Object
import LibraryApi.Scalar
import LibraryApi.ScalarCodecs
import LibraryApi.Union


type alias AuthorsRequiredArguments =
{ name : String }


authors :
AuthorsRequiredArguments
-> SelectionSet decodesTo LibraryApi.Object.Author
-> SelectionSet (List decodesTo) RootQuery
authors requiredArgs____ object____ =
Object.selectionForCompositeField "authors" [ Argument.required "name" requiredArgs____.name Encode.string ] object____ (Basics.identity >> Decode.list)


type alias BooksRequiredArguments =
{ title : String }


books :
BooksRequiredArguments
-> SelectionSet decodesTo LibraryApi.Object.Book
-> SelectionSet (List decodesTo) RootQuery
books requiredArgs____ object____ =
Object.selectionForCompositeField "books" [ Argument.required "title" requiredArgs____.title Encode.string ] object____ (Basics.identity >> Decode.list)
10 changes: 10 additions & 0 deletions frontend/src/LibraryApi/Scalar.elm
@@ -0,0 +1,10 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Scalar exposing (..)


placeholder : String
placeholder =
""
10 changes: 10 additions & 0 deletions frontend/src/LibraryApi/ScalarCodecs.elm
@@ -0,0 +1,10 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.ScalarCodecs exposing (..)


placeholder : String
placeholder =
""
26 changes: 26 additions & 0 deletions frontend/src/LibraryApi/Subscription.elm
@@ -0,0 +1,26 @@
-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql
-- https://github.com/dillonkearns/elm-graphql


module LibraryApi.Subscription exposing (..)

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 (SelectionSet)
import Json.Decode as Decode exposing (Decoder)
import LibraryApi.InputObject
import LibraryApi.Interface
import LibraryApi.Object
import LibraryApi.Scalar
import LibraryApi.ScalarCodecs
import LibraryApi.Union


allBooks :
SelectionSet decodesTo LibraryApi.Object.Book
-> SelectionSet decodesTo RootSubscription
allBooks object____ =
Object.selectionForCompositeField "allBooks" [] object____ Basics.identity

0 comments on commit 61a113a

Please sign in to comment.