zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

[Please Help]Request Headers Converting to Array #1110

Closed manuelist closed 2 years ago

manuelist commented 2 years ago

Hello is there a way to convert request headers to non array? Thanks in advance

My expected behavior is. x-authid: df3c6255-041f-4df0-86bb-f83504bfc10d

Screen Shot 2022-04-22 at 9 26 44 AM

What happening now in my flutter app is the headers is converting into array. x-authid: [df3c6255-041f-4df0-86bb-f83504bfc10d]

Screen Shot 2022-04-21 at 9 52 22 PM

Here is my sample code

 GraphQLClient clientToQuery([String? accessToken]) {
    final httpLinks = HttpLink(
        server,
        defaultHeaders: <String, String>{
          'x-authid': 'df3c6255-041f-4df0-86bb-f83504bfc10d',
        },
      );

      return GraphQLClient(
        cache: GraphQLCache(store: HiveStore()),
        link: httpLinks,
      );
  }
vincenzopalazzo commented 2 years ago

This looks unrelated to the client, because the header is managed by https://github.com/gql-dart/gql also you can do this type of question on the discord server