You can refer to one of our recent tutorials Getting data in the form of a CSV file from Bitquery GraphQL API using NodeJS