Does anyone know of a way to insert the pagination...
# help-connector-development
a
Does anyone know of a way to insert the pagination options into the request_body_data as a variable for a graphql source? The documentation seems to only provide the ability to access these values by appending them to the end of an API request.
a
Something like the following may work:
Copy code
page_size_option:
          inject_into: body_json
          type: RequestOption
          field_name: pageSize
I got the above YAML from a connector-builder-generated YAML file https://docs.airbyte.com/connector-development/config-based/connector-builder-ui (if it doesn’t work for your case, you may be able to use the UI to help you to figure out how your YAML should look)
a
That’s a good idea @Alex Marquardt (Airbyte). I’ve attempted to execute the suggested formatting while stepping through the debugger in an attempt to find out where I could point to the
field_name
. When I get to the
_create_prepared_request
function, I see the following for my
data
dict:
Copy code
{'query': 'query {orders(updatedAtStart:"2023-02-03T00:00:00",updatedAtEnd:"2023-02-03T23:59:59", offset:"", limit:"") {appliedCoupons{id},...,updatedAt}}', 'page_size': 50}
This shows that the
page_size
is getting added into the
data
dict as a separate key instead of being injected into the
query
key within the
data
dict. Here is how my stream is defined. Do you know what function executes the jinja syntax? Maybe I could set a breakpoint at that function and see if there is a way there to extract that information.
a
I’m not much of an expert on the connector YAML syntax, perhaps someone else may be able to offer better guidance.
a
I think you were right in that it needs to be injected into
body_json
. The question is how to go about calling those variables within the request. Do you know of someone on the team that could maybe provide some further guidance on this? I see there is an open task for this on github, but maybe there’s an alternative interim solution to this issue? ?