Skip to content

Commit

Permalink
Added type checking for object-type values in field and argument pres…
Browse files Browse the repository at this point in the history
…ets (#1566)

<!-- The PR description should answer 2 important questions: -->

### What
Enabled type checking for preset values provided to fields or arguments
of object types in type, command, or model permissions. This check is
controlled by a compatibility flag, with the date set to the next
release. A warning will be issued for projects with older compatibility
dates. Type check also extended to fields within an object having object
types (nested fields).

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
Type-checking functions now report issues for object-type value
type-check failures. These are raised as warnings for existing projects
and as strict errors for new projects or those with the latest
compatibility dates.

V3_GIT_ORIGIN_REV_ID: 840c4f2e5ef2bd9c5c307528c3f797fe7ba2070b
  • Loading branch information
rakeshkky authored and hasura-bot committed Jan 27, 2025
1 parent c0d80ee commit cc8e7a5
Show file tree
Hide file tree
Showing 33 changed files with 5,194 additions and 76 deletions.
5 changes: 4 additions & 1 deletion v3/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

### Added

- Added type checking for object-type values in field presets within type
permissions and for argument presets in model or command permissions.
- Allow environment variables to be used in permission filters.

### Fixed

### Changed
Expand All @@ -15,7 +19,6 @@
- Added configuration for headers in response to client for requests handled by
the pre-route plugin hook.
- Added OpenAPI schema for filter parameters in JSONAPI
- Allow environment variables to be used in permission filters.

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions v3/crates/compatibility/src/compatibility_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,9 @@ pub fn get_compatibility_date_for_flag(flag: Flag) -> Option<CompatibilityDate>
Flag::DisallowDuplicateAggregateFunctionDefinitionsForScalarType => {
Some(new_compatibility_date(2025, 1, 25))
}
Flag::TypecheckObjectTypeValuesInPresets => {
// TODO Set a compatibility date during the next release.
None
}
}
}
Loading

0 comments on commit cc8e7a5

Please sign in to comment.