in the project built by vue, use the apollo package to do the graphql query. You want to add the request header. The document looks like this:
let apollo: ApolloClient = {
let configuration = URLSessionConfiguration.default
// Add additional headers as needed
configuration.httpAdditionalHeaders = ["Authorization": "Bearer <token>"] // Replace `<token>`
let url = URL(string: "http://localhost:8080/graphql")!
return ApolloClient(networkTransport: HTTPNetworkTransport(url: url, configuration: configuration))
}()
well, it probably means that when creating a query client, add the networkTransport configuration parameter, this HTTPNetworkTransport is imported from where, can not be found, ah, the networkTransport configuration parameter is not entered from the ApolloClient, ah, whether the usage has been changed and the document has not been updated.
has anyone ever done this, under the guidance.
apollo-client version 2.2.5