zhangshenghang commented on code in PR #10303:
URL: https://github.com/apache/seatunnel/pull/10303#discussion_r2672129246


##########
seatunnel-connectors-v2/connector-graphql/src/main/java/org/apache/seatunnel/connectors/seatunnel/graphql/source/GraphQLSource.java:
##########
@@ -49,7 +58,24 @@ public String getPluginName() {
 
     @Override
     protected void buildSchemaWithConfig(ReadonlyConfig pluginConfig) {
-        super.buildSchemaWithConfig(pluginConfig);
+        if 
(pluginConfig.getOptional(ConnectorCommonOptions.SCHEMA).isPresent()) {
+            this.catalogTable = CatalogTableUtil.buildWithConfig(pluginConfig);
+            this.deserializationSchema = new 
JsonDeserializationSchema(catalogTable, false, false);
+            Config config = pluginConfig.toConfig();
+            if (config.hasPath(HttpSourceOptions.JSON_FIELD.key())) {
+                jsonField = 
getJsonField(config.getConfig(HttpSourceOptions.JSON_FIELD.key()));
+            }
+            if (config.hasPath(HttpSourceOptions.CONTENT_FIELD.key())) {
+                contentField = 
config.getString(HttpSourceOptions.CONTENT_FIELD.key());
+            }
+        }
+    }
+
+    private JsonField getJsonField(Config jsonFieldConf) {
+        ConfigRenderOptions options = ConfigRenderOptions.concise();
+        return JsonField.builder()
+                .fields(JsonUtils.toMap(jsonFieldConf.root().render(options)))
+                .build();
     }

Review Comment:
   It seems to be exactly the same as the method in the parent class and can be 
deleted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to