I also had trouble with the example graphql dgraph setup on Windows, with similar errors. I’m pretty new to this, but here’s some of the "watch out"s I found - not sure if it applies to your case or not…
I had a type with no defined attributes of its own (implemented an interface), which dgraph didn’t like
It was sensitive to single vs double quotes (e.g. ‘{ query: …’ had to be “{ query: …” Everything in the “mutation addSchema…” still had to be double quotes too, so I had to escape those as well)
I couldn’t figure out setting and getting Windows command prompt variables, so I wound up outputting the cleaned schema (with newline characters removed) to a temporary text file, and read that in as a variable to jq
I’m using node, so below is the final script that I wound up adding to my package.js: "dgraph:migrate": "cat db-schema.graphql | tr '\\n' ' ' > db-schema-string.txt && jq -n --rawfile schema db-schema-string.txt \"{query: \\\"mutation addSchema($sch: String!) { addSchema(input: { schema: $sch }) { schema { schema } } }\\\", variables: { sch: $schema }}\" | curl -X POST -H \"Content-Type: application/json\" http://localhost:9000/admin -d @- | jq -r"