private Variable parseVariable() throws EGraphQLException, IOException { Variable result = new Variable(); consumePunctuation("$"); result.setName(consumeName()); consumePunctuation(":"); result.setTypeName(consumeName()); if (hasPunctuation("=")) { consumePunctuation("="); result.setDefaultValue(parseValue()); } return result; }
private void processVariables(Operation op) throws EGraphQLException { for (Variable varRef : op.getVariables()) { Argument varDef = null; for (Argument v : graphQL.getVariables()) if (v.getName().equals(varRef.getName())) varDef = v; if (varDef != null) workingVariables.put(varRef.getName(), varDef); // todo: check type? else if (varRef.getDefaultValue() != null) workingVariables.put(varRef.getName(), new Argument(varRef.getName(), varRef.getDefaultValue())); else throw new EGraphQLException("No value found for variable "); } }
private Variable parseVariable() throws EGraphQLException, IOException { Variable result = new Variable(); consumePunctuation("$"); result.setName(consumeName()); consumePunctuation(":"); result.setTypeName(consumeName()); if (hasPunctuation("=")) { consumePunctuation("="); result.setDefaultValue(parseValue()); } return result; }
private void processVariables(Operation op) throws EGraphQLException { for (Variable varRef : op.getVariables()) { Argument varDef = null; for (Argument v : graphQL.getVariables()) if (v.getName().equals(varRef.getName())) varDef = v; if (varDef != null) workingVariables.put(varRef.getName(), varDef); // todo: check type? else if (varRef.getDefaultValue() != null) workingVariables.put(varRef.getName(), new Argument(varRef.getName(), varRef.getDefaultValue())); else throw new EGraphQLException("No value found for variable "); } }