Skip to content

Error parsing JSON from getData() #43

Closed
@aryzing

Description

@aryzing

The code I'm running looks like

  const schema = `
    name: string @index(fulltext) .
    email: string @index(exact) .
  `;
  const op = new dgraph.Operation();
  op.setSchema(schema);
  const result = await dgraphClient.alter(op);
  return result.getData();

However, the getData() call is reporting a JSON parse error:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Payload.getData (/home/aryzing/workspace/anccre-server/node_modules/dgraph-js/lib/types.js:30:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions