Skip to content

feat: gql_builder module, LayrzConnector migration, and v3.8.0 release#180

Merged
PHKenny merged 6 commits into
mainfrom
development
Apr 18, 2026
Merged

feat: gql_builder module, LayrzConnector migration, and v3.8.0 release#180
PHKenny merged 6 commits into
mainfrom
development

Conversation

@PHKenny
Copy link
Copy Markdown
Contributor

@PHKenny PHKenny commented Apr 18, 2026

📋 Summary

  • Introduces a composable gql_builder module for type-safe GraphQL query/mutation construction
  • Moves LayrzConnector into the api/ module and switches all callers to the new builder
  • Adds assets, assetsIds, and enableLttb fields to LayrzChart/LayrzChartInput
  • Bumps version to 3.8.0

✨ Features

  • New gql_builder primitives: GqlQuery, GqlMutation, GqlFragment, GqlField, GqlVariable
  • GqlVariableType.list with listOf + nestedRequired for [ID]! and [ID!]! variants
  • GqlVariableType.input with inputName for GraphQL input object types
  • GqlField.args for field-level argument rendering (e.g. charts(apiToken: $apiToken))
  • Avatar.gqlFragment reusable fragment, used in User and Locator fragments
  • Fragment collection is automatic — builder walks the field tree at generation time; no explicit fragments: list needed
  • Added assets, assetsIds, and enableLttb to LayrzChart and LayrzChartInput

♻️ Refactor

  • Moved LayrzConnector from lib/src/utils/ into lib/src/api/; still reachable via the top-level barrel
  • LayrzConnector.perform(Gql) replaces the raw-string perform(query:, variables:) method
  • All API callers migrated to the builder: LayrzChart, LayrzChartInput, Access, User, Locator, LocatorInput, MapLayer, MapLayerInput, Poi, PoiInput, Token, RegisteredApp

🔧 Chore / Config

  • Bumped version to 3.8.0 and updated CHANGELOG.md

🤖 Generated with Claude Code

PHKenny and others added 6 commits April 17, 2026 18:25
…tion to LayrzChart

- Added List<Asset>? assets, List<String>? assetsIds and bool? enableLttb to LayrzChart (freezed)
- Added @default([]) List<String> assetsIds and @default(true) bool enableLttb to LayrzChartInput
- Split LayrzChartInput into its own part file (src/chart_input.dart) mirroring Locator layout
- Added fetch, fetchAll, fetchAllLight, delete, deleteMultiple methods to LayrzChart
- Added save method to LayrzChartInput
- Added graphqlFragment, fetchSingleQuery, fetchAllGraphqlQuery, fetchAllLightGraphqlQuery,
  deleteGraphqlMutation, addGraphqlMutation, editGraphqlMutation string getters

Co-Authored-By: Claude <claude@anthropic.com>
- Ported gql_builder (GqlVariable, GqlField, GqlFragment, GqlQuery,
  GqlMutation) into lib/src/api/src/gql_builder/
- Extended GqlVariable with list type (nestedRequired for [ID]! vs
  [ID!]!), input type (inputName), and withValue() for runtime binding
- Added args: Map<String,String> to GqlField for field-level arguments
- Moved LayrzConnector from lib/src/utils/ into lib/src/api/, updating
  perform() to accept a Gql object instead of raw query strings
- Updated api.dart, utils.dart, and three library headers accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced hardcoded GraphQL string getters (graphqlFragment,
fetchAllGraphqlQuery, addGraphqlMutation, etc.) with inline GqlQuery /
GqlMutation builder calls across all 12 model files:

- Access / AccessInput (id and uuid variants)
- RegisteredApp
- LayrzChart / LayrzChartInput
- Locator / LocatorInput (including cross-model fragment composition)
- MapLayer / MapLayerInput
- Poi / PoiInput
- Token
- User

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracted the repeated dynamicAvatar field set (type, url, icon, emoji,
base64) into Avatar.gqlFragment so callers reference it via fragment
spread rather than inlining five fields each time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…me flag

- Replace explicit fragments list with runtime collection via _collectFragments()
  that recursively walks the field tree and deduplicates by fragment name
- Add includeTypename flag (default false) to control __typename injection
- Fix GqlMutation/GqlQuery usage across all callers (delete ops, mutations)
- Remove unused explicit imports in migrated model files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📋 Changelog Summary

This PR includes the following changes:

✨ Features

  • add Avatar.gqlFragment and use it in User and Locator fragments (88eb41b by @PHKenny, Claude Sonnet 4.6)
  • add gql_builder module and move LayrzConnector into api/ (83da514 by @PHKenny, Claude Sonnet 4.6)
  • add assets, assetsIds, enableLttb fields and API caller integration to LayrzChart (d73ab22 by @PHKenny, Claude)

♻️ Refactoring

  • auto-collect fragments in gql_builder and add includeTypename flag (0074610 by @PHKenny, Claude Sonnet 4.6)
  • migrate all API callers to gql_builder (d75b8fb by @PHKenny, Claude Sonnet 4.6)

🤖 Auto-generated by changelog workflow

@github-actions
Copy link
Copy Markdown

📊 Test Coverage Report

🎯 Dart/Flutter

Metric Value
Coverage 10.5%
Lines covered 14810 / 448
Lines missing -14362

🤖 Generated by coverage workflow

@PHKenny PHKenny merged commit 86aafce into main Apr 18, 2026
4 checks passed
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