Improve data marshaling between Perl and GraphQL #17
Labels
needs improvement
Something that needs some improvement
question
Further information/thought is requested/required
Milestone
Uh oh!
There was an error while loading. Please reload this page.
We need to be able to marshal our input data from Perl. Currently we handle simple scalar type literals for input (ex:
query { setName(10, "Alice") }
), but we cannot handle complex types like lists, object literals orSchema::InputObject
types (ex:query { setAttr({ "id" : 10, "name" : "Bob" }) }
).AST nodes
We need to improve the type checking of Literal values in AST nodes, this is covered with issue #15.
The AST nodes for the complex types are actually already defined, we just do not handle the conversion of these types into Perl values.
AST to Perl Literal conversion
Our existsing conversions between
AST
nodes and Perl literals is pretty sloppy, you can see this if you look at the comments in theGraph::QL::Util::AST
package.Here is the Input Values section of the spec, which basically tells us exactly what we need to do.
Validation & Internal representations
Here is the spec from the Schema point of view, which include information like parsing input, coercions, etc.
Tests
An example test case for more complex input to arguments is currently commented out, but can be added.
See Also
This code can also be referred to for "inspiration":
Related Issues
This is related to the Schema::InputObject work in #28 in that it is about parsing argument input data, but InputObjects are just an extra layer, so not critical (hence the separate ticket).
The text was updated successfully, but these errors were encountered: