Skip to content

Enable JSONPath for GraphQL record extraction

Fred O'Loughlin requested to merge fred-oloughlin-fl/sdk:main into main

The current expectation for a graphql response is that its structure would match the stream name. There are occasions, however, when this is not the case. In such situations there is currently a need to override the parse_response method, but it would be more straightforward to use a consistent approach to the parent RESTStream and simply set the records_jsonpath variable.

Here we allow the GraphQL stream to inherit parse_response method from the RESTStream and set the default value to ensure the behaviour matches how it was before. This ensures no changes for end users who have already overridden parse_response, while allowing the use of records_jsonpath. I have added a tests to ensure this default is maintained, and that the value can be overridden.

Very open to suggestions for improvement or an alternative approach, just let me know!

Closes #327 (closed)

Edited by Edgar R. Mondragón

Merge request reports