Skip to content

Conversation

@hgiasac
Copy link

@hgiasac hgiasac commented Nov 4, 2025

This pull request refactors the codebase to replace the use of interface{} with the more modern any type throughout the project, improving readability and aligning with Go's latest conventions. Additionally, it updates function signatures, type declarations, and method implementations to use any, and makes minor improvements to comments and code clarity. There are also small adjustments to linter configuration and union type filtering logic.

Type modernization and code consistency

  • Replaced all instances of interface{} with any in function signatures, method parameters, type declarations, and map definitions across files such as graphql.go, query.go, scalar.go, and subscription.go. This includes changes to decoding, unmarshalling, logging, and GraphQL variable handling. [1] [2] [3] [4]
  • Updated map types from map[string]interface{} to map[string]any for GraphQL variables and connection parameters throughout the codebase, including public APIs and internal logic. [1] [2]

Subscription and logging improvements

  • Updated logging functions and subscription methods to use any for message and argument types, improving code clarity and consistency. [1] [2] [3] [4]
  • Updated the SubscriptionClient and related methods to use any in connection parameters, loggers, and handler functions. [1] [2] [3]

GraphQL decoding and query construction

  • Refactored decoding and unmarshalling functions in graphql.go to use any instead of interface{} for improved type safety and readability. [1] [2] [3] [4]
  • Updated query and mutation construction functions to use any for variables and struct values, and adjusted related helper functions. [1] [2] [3] [4] [5] [6] [7]

Minor improvements and fixes

  • Improved union type filtering logic in filterUnionFieldsByTypeName to simplify conditional checks and code structure.
  • Added or clarified comments for deprecated methods and behavior in subscription.go to improve documentation. [1] [2]

Linter configuration

  • Increased allowed function length and statement count in the funlen linter configuration in .golangci.yml to accommodate larger functions.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Code Coverage

Package Line Rate Health
github.com/hasura/go-graphql-client 67%
github.com/hasura/go-graphql-client/ident 100%
github.com/hasura/go-graphql-client/pkg/jsonutil 83%
Summary 71% (1903 / 2676)

Minimum allowed line rate is 60%

@hgiasac hgiasac merged commit a11edb0 into master Nov 4, 2025
2 checks passed
@hgiasac hgiasac deleted the chore/fix-linter-error branch November 4, 2025 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant