• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yahoo / elide / #7488

18 Aug 2026 12:29AM UTC coverage: 84.331% (-0.04%) from 84.37%
#7488

push

web-flow
Upgrade to Spring Boot 4 (#3413)

* Update to Spring Boot 4

* Update to Jersey 4

* Update GraphQL

* Update dependencies

* Update Hibernate

* Update dependencies

* Update dependencies

* Update json schema validator

* Upgrade to Jackson 3

* Upgrade to Atomikos Spring Boot 4 Starter

* Update dependencies

* Clean quarkus

* Resolve comments

* Update dependencies

* Revert embedded-redis.version to 0.11.0

245 of 310 new or added lines in 63 files covered. (79.03%)

7 existing lines in 6 files now uncovered.

19843 of 23530 relevant lines covered (84.33%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

63.16
/elide-graphql/src/main/java/com/yahoo/elide/graphql/parser/QueryParser.java
1
/*
2
 * Copyright 2021, Yahoo Inc.
3
 * Licensed under the Apache License, Version 2.0
4
 * See LICENSE file in project root for terms.
5
 */
6

7
package com.yahoo.elide.graphql.parser;
8

9
import tools.jackson.databind.JsonNode;
10
import tools.jackson.databind.ObjectMapper;
11

12
import java.util.ArrayList;
13
import java.util.HashMap;
14
import java.util.Iterator;
15
import java.util.List;
16
import java.util.Map;
17

18
/**
19
 * Utility functions to parse the envelope that wraps every GraphQL query.
20
 */
21
public interface QueryParser {
22

23
    static final String QUERY = "query";
24
    static final String OPERATION_NAME = "operationName";
25
    static final String VARIABLES = "variables";
26

27
    /**
28
     * Parse a document which could consist of 1 or more GraphQL queries.
29
     * @param message The document to parse.
30
     * @param mapper An object mapper to do JSON parsing.
31
     * @return A list of 1 or more parsed GraphQL queries.
32
     */
33
    default List<GraphQLQuery> parseDocument(String message, ObjectMapper mapper) {
34
        List<GraphQLQuery> results = new ArrayList<>();
1✔
35
        JsonNode topLevel = mapper.readTree(message);
1✔
36

37
        if (topLevel.isArray()) {
1✔
38
            Iterator<JsonNode> nodeIterator = topLevel.iterator();
×
39

40
            while (nodeIterator.hasNext()) {
×
41
                JsonNode document = nodeIterator.next();
×
42

43
                results.add(parseQuery(document, mapper));
×
44
            }
×
45
        } else {
×
46
            results.add(parseQuery(topLevel, mapper));
1✔
47
        }
48

49
        return results;
1✔
50
    }
51

52
    /**
53
     * Parse a GraphQL query.
54
     * @param topLevel The query JsonNode to further parse.
55
     * @param mapper An object mapper to do JSON parsing.
56
     * @return A parsed GraphQL queries.
57
     */
58
    default GraphQLQuery parseQuery(JsonNode topLevel, ObjectMapper mapper) {
59
        String query = topLevel.has(QUERY) ? topLevel.get(QUERY).asString() : null;
1✔
60
        String operationName = "";
1✔
61

62
        Map<String, Object> variables = new HashMap<>();
1✔
63
        if (topLevel.has(VARIABLES) && !topLevel.get(VARIABLES).isNull()) {
1✔
64
            variables = mapper.convertValue(topLevel.get(VARIABLES), Map.class);
1✔
65
        }
66

67
        if (topLevel.has(OPERATION_NAME) && !topLevel.get(OPERATION_NAME).isNull()) {
1✔
NEW
68
            operationName = topLevel.get(OPERATION_NAME).asString();
×
69
        }
70

71
        return new GraphQLQuery(query, operationName, variables);
1✔
72
    }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc