NavidK0 / SimpleGraphQL-For-Unity

A simple graphQL client that allows one to use .graphql files (or code) for queries, mutations, and subscriptions with Unity.
MIT License
34 stars 18 forks source link

Old projects not compiling after upgrading minor version #41

Closed johanhelsing closed 2 years ago

johanhelsing commented 2 years ago

After upgrading, my project stopped working due to this change:

https://github.com/LastAbyss/SimpleGraphQL-For-Unity/commit/b4a473becf9d0558d1b103dddc1826c23a81f582

The code that stopped building

            var result = await apiClient.Send(
                () => new { result = resultTypeResolver() },
                request,
                null,
                token,
                scheme);
            var result = await apiClient.Send(
                () => new { result = resultTypeResolver() },
                request,
                null, // <-- needed to add this argument after upgrading to latest version
                null,
                token,
                scheme);

We should probably either bump major version or restore an overload with the old api, or move the settings arg so it's the last overload.

NavidK0 commented 2 years ago

Done with https://github.com/LastAbyss/SimpleGraphQL-For-Unity/commit/1e987605ca452ec62dd142b36a26b8f208257819

I think we are starting to reach the point where we may want to use a configuration object parameter (similar to JavaScript), instead of many parameters.

Perhaps something like SendRequestSettings or similar.

NavidK0 commented 2 years ago

I think that API could look like

var result = await apiClient.Send(
      () => new { result = resultTypeResolver() },
      request,
      new {
          Token = token,
          Scheme = scheme
      }
  );