Skip to content

Commit

Permalink
Merge pull request #213 from wilkerlucio/fix-optional-helper-spec
Browse files Browse the repository at this point in the history
Fix spec for pco/?
  • Loading branch information
wilkerlucio authored Jun 13, 2024
2 parents 2d9d1cf + 561a068 commit 878febb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Idents run in parallel when using parallel processor (issue #208)
- Fix wrong input order on nested resolvers (issue #205)
- Fix `pf.eql/map-select` case on map container at query
- Fix spec for `pco/?`

## [2023.08.22-alpha]
- BREAKING: `::p.error/missing-output` is now converged to `::p.error/attribute-missing` (issue #149)
Expand Down
3 changes: 3 additions & 0 deletions src/main/com/wsscode/pathom3/attribute.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
[com.fulcrologic.guardrails.core :refer [<- => >def >defn >fdef ? |]]))

(>def ::attribute keyword?)
(>def ::parameterized-attribute (s/and seq? (s/cat :attr ::attribute :params (s/? ::params))))
(>def ::attribute-maybe-parameterized (s/or :plain-attr ::attribute :parameterized ::parameterized-attribute))

(>def ::attributes-set (s/coll-of ::attribute :kind set?))
2 changes: 1 addition & 1 deletion src/main/com/wsscode/pathom3/connect/operation.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
(>defn ?
"Make an attribute optional"
[attr]
[::p.attr/attribute => any?]
[::p.attr/attribute-maybe-parameterized => any?]
(eql/update-property-param attr assoc ::optional? true))

(>defn operation-config [operation]
Expand Down

0 comments on commit 878febb

Please sign in to comment.