public Map toSpecification()

in graphql-error-types/src/main/java/com/netflix/graphql/types/errors/TypedGraphQLError.java [87:105]


    public Map<String, Object> toSpecification() {
        // We override toSpecification and explicitly don't delegate
        // to GraphqlErrorHelper.toSpecification because it will add
        // classification to extensions, but our builder has already
        // handled that.

        Map<String, Object> errorMap = newLinkedHashMap(4);
        errorMap.put("message", message);
        if (locations != null) {
            errorMap.put("locations", GraphqlErrorHelper.locations(locations));
        }
        if (path != null) {
            errorMap.put("path", path);
        }
        if (extensions != null) {
            errorMap.put("extensions", extensions);
        }
        return errorMap;
    }