|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2022 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
26 | 26 | import org.springframework.core.codec.Encoder;
|
27 | 27 | import org.springframework.core.io.buffer.DataBuffer;
|
28 | 28 | import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
29 |
| -import org.springframework.graphql.GraphQlResponse; |
30 | 29 | import org.springframework.graphql.server.support.SerializableGraphQlRequest;
|
31 | 30 | import org.springframework.http.MediaType;
|
32 | 31 | import org.springframework.http.codec.CodecConfigurer;
|
@@ -77,9 +76,9 @@ private static Encoder<?> findJsonEncoder(CodecConfigurer configurer) {
|
77 | 76 |
|
78 | 77 |
|
79 | 78 | @SuppressWarnings("unchecked")
|
80 |
| - DataBuffer encode(GraphQlResponse response) { |
81 |
| - return ((Encoder<Map<String, Object>>) this.encoder) |
82 |
| - .encodeValue(response.toMap(), DefaultDataBufferFactory.sharedInstance, RESPONSE_TYPE, MimeTypeUtils.APPLICATION_JSON, null); |
| 79 | + DataBuffer encode(Map<String, Object> resultMap) { |
| 80 | + return ((Encoder<Map<String, Object>>) this.encoder).encodeValue( |
| 81 | + resultMap, DefaultDataBufferFactory.sharedInstance, RESPONSE_TYPE, MimeTypeUtils.APPLICATION_JSON, null); |
83 | 82 | }
|
84 | 83 |
|
85 | 84 | @SuppressWarnings("unchecked")
|
|
0 commit comments