In the world of GraphQL it's very common to reach for Apollo, a library that handles turning GraphQL queries into functions, leveraging tooling to turn those functions into type-safe API requests the client can make. DataTaskPublisher { var request = URLRequest ( url : url ) request . DataTaskPublisher { let request = URLRequest ( url : url , graphQLQuery : query ) return self .