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 EffectfulQueryBuilder for higher-level API on top of RootEffect / GenericMapping #1

Open
wants to merge 4 commits into
base: add-contramap-cursor-builder
Choose a base branch
from

Conversation

dantb
Copy link
Owner

@dantb dantb commented Dec 28, 2022

Initial rough attempt at a higher-level library API combining RootEffect and GenericMapping to build a read-only GraphQL API. Trying to add some type-safety to the arguments and hide away select elaboration, RootEffect, genericCursor etc, behind a builder pattern. Managed to allow constructing EffectfulQuery values independently and compose them; eventually calling build with a schema to create the mapping. Ideally the schema / queries would be tied together at compile time, but I imagine that would be wholly invasive and quite complicated... The Caliban library seems to do that, though it didn't work as expected when I last tried it.

Still needs a lot of tidy up, particularly to make adding arguments better. Perhaps another builder pattern in the construction of an EffectfulQuery, to avoid the verbose arg1, arg2 constructors.

Note to self - this is currently blocked by there being no way to create a CursorBuilder other than using semiauto which is in the mapping scope. Ask for help on this - either that can be extracted or we can add options for manual creation of CursorBuilders, similar to circe Encoders.

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.

1 participant