ADF can be used for your GraphQL-to-Azure SQL Database pipeline, but as you’ve observed, it's not inherently designed for GraphQL. ADF excels with REST APIs but requires workarounds for GraphQL, especially with pagination and cursor handling.
As you mentioned, using a variable to manage the cursor pagination logic in ADF is viable. You’d initialize the cursor value, use it in each request, and update it iteratively based on the hasNextPage
response. This approach requires multiple Copy Data activities or web requests in a ForEach activity loop until the hasNextPage
is false
.
ADF's data flow transformation will help flatten the JSON, but if handling the GraphQL structure becomes cumbersome, consider transforming JSON in a staging area (like Azure Storage) and running data flow transformations from there.
The error you encountered (Unsupported content-encoding "utf-8"
) could stem from ADF not interpreting the response’s encoding correctly. Try setting headers explicitly for content type (application/json
) and encoding in the Web activity or REST connector. If this continues, another option is to preprocess the data outside ADF or leverage a service like Azure Functions for custom handling.
If ADF feels too complex for this, consider Azure Functions, which offers more flexibility to handle complex GraphQL queries, pagination, and custom error handling. Logic Apps can also orchestrate API calls with stateful handling of pagination and could output the final result to ADF for further processing.
In my opinion, ADF can handle this with some effort, but if your proof of concept reveals significant issues, combining it with Azure Functions for the GraphQL API call handling might be more streamlined.