public void execute() throws EGraphEngine, EGraphQLException, FHIRException { if (graphQL == null) throw new EGraphEngine("Unable to process graphql - graphql document missing"); fpe = new FHIRPathEngine(this.context); magicExpression = new ExpressionNode(0); output = new ObjectValue(); Operation op = null; // todo: initial conditions if (!Utilities.noString(graphQL.getOperationName())) { op = graphQL.getDocument().operation(graphQL.getOperationName()); if (op == null) throw new EGraphEngine("Unable to find operation \""+graphQL.getOperationName()+"\""); } else if ((graphQL.getDocument().getOperations().size() == 1)) op = graphQL.getDocument().getOperations().get(0); else throw new EGraphQLException("No operation name provided, so expected to find a single operation"); if (op.getOperationType() == OperationType.qglotMutation) throw new EGraphQLException("Mutation operations are not supported (yet)"); checkNoDirectives(op.getDirectives()); processVariables(op); if (focus == null) processSearch(output, op.getSelectionSet(), false, ""); else processObject(focus, focus, output, op.getSelectionSet(), false, ""); }
public void execute() throws EGraphEngine, EGraphQLException, FHIRException { if (graphQL == null) throw new EGraphEngine("Unable to process graphql - graphql document missing"); fpe = new FHIRPathEngine(this.context); magicExpression = new ExpressionNode(0); output = new ObjectValue(); Operation op = null; // todo: initial conditions if (!Utilities.noString(graphQL.getOperationName())) { op = graphQL.getDocument().operation(graphQL.getOperationName()); if (op == null) throw new EGraphEngine("Unable to find operation \""+graphQL.getOperationName()+"\""); } else if ((graphQL.getDocument().getOperations().size() == 1)) op = graphQL.getDocument().getOperations().get(0); else throw new EGraphQLException("No operation name provided, so expected to find a single operation"); if (op.getOperationType() == OperationType.qglotMutation) throw new EGraphQLException("Mutation operations are not supported (yet)"); checkNoDirectives(op.getDirectives()); processVariables(op); if (focus == null) processSearch(output, op.getSelectionSet(), false, ""); else processObject(focus, focus, output, op.getSelectionSet(), false, ""); }