Why not have the query in JSON? Now you need a new parser.
EDIT: Thanks for all the replies, all of them very good points, and clearly show that JSON is not the most elegant option for a complex DSL.
EDIT: Thanks for all the replies, all of them very good points, and clearly show that JSON is not the most elegant option for a complex DSL.
query UseFragment {
luke: human(id: "1000") {
...HumanFragment
}
leia: human(id: "1003") {
...HumanFragment
}
}
fragment HumanFragment on Human {
name
homePlanet
}
You could definitely have some JSON to represent this but it might turn out to be more trouble than it's worth...you could map it to json - but technically you could map everything to json - doesnt mean you decrease complexity
the parser is the lowest problem of parsing and optimizing those queries i'd assume