private List<Value> resolveValues(Argument arg, int max, String vars) throws EGraphQLException { List<Value> result = new ArrayList<Value>(); for (Value v : arg.getValues()) { if (! (v instanceof VariableValue)) result.add(v); else { if (vars.contains(":"+v.toString()+":")) throw new EGraphQLException("Recursive reference to variable "+v.toString()); Argument a = workingVariables.get(v.toString()); if (a == null) throw new EGraphQLException("No value found for variable \""+v.toString()+"\" in \""+arg.getName()+"\""); List<Value> vl = resolveValues(a, -1, vars+":"+v.toString()+":"); result.addAll(vl); } } if ((max != -1 && result.size() > max)) throw new EGraphQLException("Only "+Integer.toString(max)+" values are allowed for \""+arg.getName()+"\", but "+Integer.toString(result.size())+" enoucntered"); return result; }
private Argument parseArgument() throws EGraphQLException, IOException { Argument result = new Argument(); result.setName(consumeName()); consumePunctuation(":"); if (hasPunctuation("[")) { result.setListStatus(ArgumentListStatus.REPEATING); consumePunctuation("["); while (!hasPunctuation("]")) result.getValues().add(parseValue()); consumePunctuation("]"); } else result.getValues().add(parseValue()); return result; }
for (Value nextValue : nextArgument.getValues()) { String value = nextValue.getValue();
if (sel.getField().hasDirective("slice")) { Directive dir = sel.getField().directive("slice"); String s = ((StringValue) dir.getArguments().get(0).getValues().get(0)).getValue(); if (s.equals("$index")) expression = magicExpression;
private List<Value> resolveValues(Argument arg, int max, String vars) throws EGraphQLException { List<Value> result = new ArrayList<Value>(); for (Value v : arg.getValues()) { if (! (v instanceof VariableValue)) result.add(v); else { if (vars.contains(":"+v.toString()+":")) throw new EGraphQLException("Recursive reference to variable "+v.toString()); Argument a = workingVariables.get(v.toString()); if (a == null) throw new EGraphQLException("No value found for variable \""+v.toString()+"\" in \""+arg.getName()+"\""); List<Value> vl = resolveValues(a, -1, vars+":"+v.toString()+":"); result.addAll(vl); } } if ((max != -1 && result.size() > max)) throw new EGraphQLException("Only "+Integer.toString(max)+" values are allowed for \""+arg.getName()+"\", but "+Integer.toString(result.size())+" enoucntered"); return result; }
private Argument parseArgument() throws EGraphQLException, IOException { Argument result = new Argument(); result.setName(consumeName()); consumePunctuation(":"); if (hasPunctuation("[")) { result.setListStatus(ArgumentListStatus.REPEATING); consumePunctuation("["); while (!hasPunctuation("]")) result.getValues().add(parseValue()); consumePunctuation("]"); } else result.getValues().add(parseValue()); return result; }
for (Value nextValue : nextArgument.getValues()) { String value = nextValue.getValue();
if (sel.getField().hasDirective("slice")) { Directive dir = sel.getField().directive("slice"); String s = ((StringValue) dir.getArguments().get(0).getValues().get(0)).getValue(); if (s.equals("$index")) expression = magicExpression;