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

Servant-inspired typesafe API #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

farnoy
Copy link

@farnoy farnoy commented Aug 3, 2016

This is an early draft but is usable and I made specs test it too.

We could more easily generate introspection data from this notation. Adding __typename under every Object type would also be easier, but would still depend on user-supplied values (unless we could cast Haskell types to Symbols and then strings).

One downside so far is that it's not possible to define friends from the SWAPI recursively, not sure how to solve it yet.

WDYT? Is this direction worth pursuing?

@jdnavarro
Copy link
Owner

This approach is very interesting and I think it's worth pursuing, but this would deviate too much from the initial intention of this project, which is just a Haskell port of the reference JS implementation.

But I don't want to discourage you, so please continue this path on your own fork, and feel free to reach me with any doubts. Although right now I can't focus too much on it, I hope in the future I'll be able to spend more time on this.

@farnoy
Copy link
Author

farnoy commented Aug 9, 2016

I do not mean to have this approach replace the original one. It was merely an experiment I meant to build on top of the value level already provided by the library.

We should, however, come up with some specification to provide the value level functions some form of type annotations / naming. I'm not sure what exactly would be required (to implement introspection in the future). One thing we would need is, for example, the type name. We could do it like this:

-- old
object "movie" [ scalar ... ]
-- new
object "movie" "Movie" [ scalar ... ]

I understand you're busy, but agreeing on a way to pass all the required stuff in would be helpful to coordinate work.

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.

2 participants