-
Notifications
You must be signed in to change notification settings - Fork 9
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
Client support #111
base: master
Are you sure you want to change the base?
Client support #111
Conversation
This file seems to be an excerpt from an old version of graphql-js: https://github.com/graphql/graphql-js/blob/9579758ee877962ae9b6f158fe4f6fe3519002f0/src/language/parser.js However, it is missing declarations from the top of the file and does not seem to be a valid program.
It is useful to track lockfiles even for library projects, as it allows running the tests to be more deterministic.
Add ignore rules for: - static library (created by "dub build") - test program (created by "dub test")
Prepare for splitting up into sub-packages.
The main goal is to separate the code by external dependencies, so that it is possible to use parts of this package without requiring a dependency on all of Vibe.d (for example, if we want to write a GraphQL client).
GraphQL does not really have "reserved keywords" as such, so field names such as "input", "type" and "query" are valid. This commit explicitly enumerates alphabetic tokens as valid field names. This is a bit of a hack and probably should be solved more properly in Darser.
Proof of concept for basic D code generation for type-safe GraphQL queries (variables and payloads).
Just as strings for now.
Ensure we don't collide with any identifiers called "Nullable" in the GraphQL schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing really to complain about, just a few nitpicks
@@ -0,0 +1,102 @@ | |||
name "graphqld" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please keep the dub.json file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't convert it losslessly - we'd lose the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe YAML?
baseType = baseType.list.ptr; | ||
wrappers ~= s => s ~ "[]"; | ||
} | ||
else if (baseType.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add { } everwhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and they go at the end of the line, phobos style is ugly
static assert(is(typeof(query.ReturnType.snan.get()[0].get().i) == int)); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query gets every field in the schema, could you please at a test for 1 field as well please
Early proof of concept of generating D types from queries/schemas.