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

Extended IDL syntax #1

Open
charlieschwabacher opened this issue Jun 26, 2016 · 2 comments
Open

Extended IDL syntax #1

charlieschwabacher opened this issue Jun 26, 2016 · 2 comments

Comments

@charlieschwabacher
Copy link
Owner

charlieschwabacher commented Jun 26, 2016

It would be nice if you could write relationships as:

type User implements Node {
  name: String
  posts: =AUTHORED=> Post
}

instead of:

type User implements Node {
  name: String
  posts: Post @relationship(path: "=AUTHORED=>")
}

This puts the arrow in a place that feels more natural and better matches Cypher.

It would be easy to define a preprocessing step that converts the first syntax into the second before passing to the graphlq-js parser. I 100% prefer the first syntax, but am concerned about compatibility w/ other tools if we introduce syntax extensions.

On the other hand, having a base schema that gets prepended already could make this difficult so maybe there isn't that much to lose, and we can always write the complete translated schema to a file or something.

@sichacvah
Copy link

sichacvah commented Apr 14, 2017

Hi! Gestlat is great project! What about use decorators instead of patch syntax? Users will be able to create their own decorators for custom logic

@charlieschwabacher
Copy link
Owner Author

charlieschwabacher commented May 16, 2017

Thanks!

I do like the prefix notation of decorators quite a bit better than postfix directives, but it looks like the spec will include directives (graphql/graphql-spec#90).

If we do break spec compliance, I'd like to go all the way to the cypher style infix arrows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants