Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional caliban endpoint #17

Merged
merged 23 commits into from
Apr 24, 2020
Merged

Add optional caliban endpoint #17

merged 23 commits into from
Apr 24, 2020

Conversation

vpavkin
Copy link
Contributor

@vpavkin vpavkin commented Mar 19, 2020

Fix #5

For some reason I bumped into foundweekends/giter8#432, although giter plugin version is up to date.

The only consequence so far is that there's an unneeded html file in resources folder if user opts out of caliban endpoint

vpavkin added 8 commits March 18, 2020 16:19
# Conflicts:
#	src/main/g8/build.sbt
#	src/main/g8/default.properties
#	src/main/g8/src/main/scala/$package$/Boot.scala
#	src/main/g8/src/main/scala/$package$/infrastructure/SlickItemRepository.scala
vpavkin added 4 commits March 26, 2020 10:09
# Conflicts:
#	src/main/g8/build.sbt
#	src/main/g8/default.properties
#	src/main/g8/src/main/scala/$package$/Boot.scala
#	src/main/g8/src/main/scala/$package$/infrastructure/SlickItemRepository.scala
@marioosh
Copy link
Member

marioosh commented Apr 6, 2020

Does it work?? Actually I'm missing one part (maybe it's automagically covered by caliban somehow - I don't know, don't know the library so far.... :D
JSON sent to the endpoint is like this:

 { operationName: "", query: {}, variables: {} } 

query is compared along schema and passed to the executor. I don't where it's parsed, so the reason of my question. Are you able to run server and make a query in graphiql console?

@vpavkin
Copy link
Contributor Author

vpavkin commented Apr 8, 2020

@marioosh WRT how the endpoint works - I'm pretty sure it is, because I tested it with Altair. It even gets the docs properly, so you don't have to type queries by hand.

vpavkin added 3 commits April 8, 2020 08:35
# Conflicts:
#	src/main/g8/src/main/scala/$package$/Boot.scala
@vpavkin vpavkin requested a review from marioosh April 8, 2020 05:59
vpavkin and others added 3 commits April 8, 2020 09:05
* Few changes in GraphQL part:

- fixed graphiql.html with unnecessary conditionals,
- add two more queries and one mutation to make API more complete,
- Updated README

* formatting fix.

* Change ZIO[Any, Throwable, A] into alias Task[A]

* Update README.markdown

Co-Authored-By: Vladimir Pavkin <vpavkin@gmail.com>

* Update README.markdown

Co-Authored-By: Vladimir Pavkin <vpavkin@gmail.com>

* Update README.markdown

Co-Authored-By: Vladimir Pavkin <vpavkin@gmail.com>

* Update README.markdown

Co-Authored-By: Vladimir Pavkin <vpavkin@gmail.com>

* make functions composition consistent

Co-authored-by: Vladimir Pavkin <vpavkin@gmail.com>
@vpavkin
Copy link
Contributor Author

vpavkin commented Apr 22, 2020

So this is hanging for long time already :) Should I merge it after #33 is merged?

vpavkin and others added 2 commits April 22, 2020 10:15
runService function and error handling small refactor
# Conflicts:
#	src/main/g8/build.sbt
#	src/main/g8/src/main/scala/$package$/Boot.scala
#	src/main/g8/src/main/scala/$package$/infrastructure/SlickItemRepository.scala
@jczuchnowski
Copy link
Contributor

@vpavkin @marioosh sorry I've been delaying it for so long. Looks great. One thing I've been thinking is that in case someone opts out of the GraphQL endpoint, still gets the additional repository and service methods for deletion events, custom search by price etc. Don't you think it would be better if these would also depend on $if(add_caliban_endpoint.truthy)$ ?

@vpavkin
Copy link
Contributor Author

vpavkin commented Apr 23, 2020

@jczuchnowski great catch, I missed that entirely. I can clean it up on monday

@jczuchnowski
Copy link
Contributor

Don't you have holidays on Monday? :)

@vpavkin
Copy link
Contributor Author

vpavkin commented Apr 24, 2020

Nope, my holidays start on 1st of May:) Actually finished project a day earlier, so plan to merge this today :)

@vpavkin
Copy link
Contributor Author

vpavkin commented Apr 24, 2020

@jczuchnowski I added a small cool thing to CI - it now runs tests for both caliban and non-caliban versions of the template. will be handy since we have a lot of conditionals there and it's easy to miss something.

@vpavkin vpavkin requested a review from jczuchnowski April 24, 2020 08:35
@vpavkin
Copy link
Contributor Author

vpavkin commented Apr 24, 2020

Cleaned everything, at least it seems so :)

@jczuchnowski jczuchnowski merged commit 85577ca into master Apr 24, 2020
@jczuchnowski jczuchnowski deleted the caliban branch April 24, 2020 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add optional GraphQL endpoint
3 participants