Commit graph

190 commits

Author SHA1 Message Date
Barnabas Jovanovics
2a4a27dcf0 handle cases where the type has no short name 2024-02-08 13:44:40 +01:00
Barnabas Jovanovics
3526f87d7e test the arguments for the function predicats, allow type if the field has the right type 2024-02-08 13:39:08 +01:00
Barnabas Jovanovics
ed6f584429 create filter fields for predicate functions 2024-02-07 09:21:39 +01:00
Zach Daniel
3b77a40667 improvement: support data layer functions (ilike, like) 2024-02-06 09:26:13 +01:00
Zach Daniel
d00ae4e315 fix: define map input types w/ nested input types 2024-02-05 13:48:22 -05:00
Zach Daniel
099540c79e fix: handle nested constraint derivation in union/map types 2024-02-04 10:36:23 -05:00
Riccardo Binetti
6b09e7309e
improvement: make the items of fields and errors non-null (#112)
Last point left from the discussion on #105
2024-01-31 17:52:33 -05:00
Riccardo Binetti
8fff0d361d
improvement: make mutation arguments non-null (#111)
* improvement: make mutation arguments non-null

As discussed in #105 and #110, put this behind an opt-in configuration to avoid
breaking existing code.
The ID in update mutations is always non-null if non-null mutation arguments are
allowed, while input is non-null if it's allowed _and_ there is at least a
non-null field in the input.

Document the newly added config variable in the getting started guide.

* chore: enable non-null mutation arguments in tests
2024-01-31 17:52:01 -05:00
Riccardo Binetti
af4193feca
improvement: make mutation results non-nullable (#110)
Adjust rool level error tests: since result is now non-nullable, if the content
of the result is nil, the whole result becomes nil. Note that this is not a
breaking change since GraphQL always allows a field nullability to propagate
upwards in case of a field error (see October 2021 spec, section 6.4.4).
2024-01-31 15:59:07 -05:00
Riccardo Binetti
afa4ae66a0
improvement: return a map from decode_relay_id/1 (#107)
Slight API improvement over #106.

This makes it more ergonomic to partially match on the return value (and it also
makes it more explicit by explicitly labeling the two parts).

Also add tests for relay id encoding/decoding.
2024-01-25 10:47:15 -05:00
Riccardo Binetti
365b3aedc6
feat: Relay refetching support (#106)
* feat: add support for relay global IDs

* improvement: use the GraphQL type when projecting fields

This allows picking also up fields coming from fragments in queries returning an
interface

* feat: add relay node query

Allow retrieving a resource implementing the Node interface given its Relay
global id.
2024-01-24 14:59:12 -05:00
Zach Daniel
e95c95282a fix: properly generate type for Ash.Type.DateTime 2023-11-28 17:32:31 -05:00
Zach Daniel
cb87e6f4f6 chore: format/credo 2023-11-13 23:23:27 -05:00
Zach Daniel
e66a3ef4b8 fix: properly generate first aggregates with correct destination type 2023-11-13 23:02:57 -05:00
Zach Daniel
2cf5b60f63 improvement: support latest ash aggregate constraints 2023-11-13 16:53:21 -05:00
Barnabas Jovanovics
34fd313901
improvement: make the node in relay edges non-null (#95)
* make the node in relay edges non-null

* make the edge non-null too

* fix edge type
2023-10-03 13:48:27 -04:00
Zach Daniel
58a038e609 fix: generic action mutations need to use the input object 2023-10-02 19:44:19 -04:00
Zach Daniel
cdb8cf7b7f fix: don't access .pagination on generic action 2023-10-02 14:47:31 -04:00
Tun Cham Roeun
4c86d31885
improvement: Add a top-level NOT filter, along with AND and OR filters. (#94) 2023-10-01 09:51:42 -04:00
Zach Daniel
ca2e5342ac fix: fix primary key delimiter verificatoin step
docs: improve docs on unions
2023-09-28 17:31:27 -04:00
Zach Daniel
fc3423b45a improvement: optimize union type resolver compile time logic 2023-09-20 09:21:44 -04:00
Zach Daniel
842e433f9f fix: don't include related fields in managed relationship inputs 2023-09-19 12:49:05 -04:00
Zach Daniel
49c6534d73 improvement: generic action support
docs: better docs
2023-09-15 13:45:12 -04:00
Zach Daniel
339a78ec98 fix: handle nested array types 2023-09-13 14:55:17 -04:00
Zach Daniel
1d69d8ef33 fix: support aggregates over calculations 2023-08-29 21:32:22 -04:00
Barnabas Jovanovics
da1d1e889c
fix: wrap type in non-null reference if allow_nil? is set to false (#90)
* fix: wrap type in non-null reference if allow_nil? is set to false

* fix: get allow_nil? from the correct place
2023-08-22 14:43:27 -04:00
Zach Daniel
700cc1adee fix: don't add filter input for non-filterable resources 2023-07-31 22:07:03 -04:00
Jeremy Grant
de149c63a5
fix(array unions): for arrays of embedded types unions when graphql_unnested_unions is used, without it they return empty values (#87) 2023-07-28 21:36:12 -04:00
Zach Daniel
bb96354470 improvement: support ForbiddenField 2023-06-23 10:10:39 -04:00
Zach Daniel
74211ef3f4 fix: properly fetch aliased all attributes 2023-06-12 13:19:07 -04:00
Zach Daniel
05be948204 improvement: revamp data loading to be a single load statement 2023-06-09 00:45:39 -04:00
Zach Daniel
309c35d405 fix: choose a better default delimiter 2023-05-18 00:16:58 -04:00
Zach Daniel
db23b32552 fix: various problems with resolving unions in relationship changes 2023-05-17 22:41:24 -04:00
Zach Daniel
6701b57afe fix: properly wrap union resolvers in a list 2023-05-17 16:20:16 -04:00
Zach Daniel
6e444da1e7 improvement: add composite pkey default delimiter 2023-05-17 14:01:20 -04:00
Zach Daniel
d80016abd7 fix: don't generate enum types when no graphql type exists 2023-05-16 12:42:10 -04:00
Zach Daniel
02dc6e0f0a chore: fix build/sobelow 2023-05-15 10:07:37 -04:00
Barnabas Jovanovics
48392115e0
feat: create types for maps with constraints (#68) 2023-05-15 09:39:32 -04:00
Zach Daniel
e0ce5c5e65 fix: don't hide fields not called :id 2023-05-08 10:57:42 -04:00
bcksl
8223797dd6
feat: add filterable_fields to limit generated filters (#69) 2023-04-28 10:04:30 -04:00
Zach Daniel
79a7145c44 improvement: support hiding fields 2023-04-26 23:40:41 -04:00
bcksl
8e6f9b7bd5
improvement: pass description through to Absinthe in more cases (#63) 2023-04-23 07:03:54 -06:00
Zach Daniel
e91001e83f improvement: better union type handling
still need to document this, but adding support for
`graphql_unnested_unions/1` on `NewType` defined unions.

This allows for lifting up union type values to not be nested under `value`
2023-04-21 01:12:20 -06:00
Zach Daniel
e83835cab9 improvement: don't define union input types for calcs/aggregates 2023-04-20 13:30:13 -06:00
Zach Daniel
d4ee7c5ac2 fix: include resource name in managed_relationship types 2023-04-16 18:15:25 -04:00
Zach Daniel
e78a9f7926 improvement: add auto? true option for managed_relationships 2023-04-16 16:52:37 -04:00
Zach Daniel
13910dd0f1 fix: handle certain types in calculations 2023-04-14 10:46:18 -04:00
Zach Daniel
6b7ea9048f fix: unique enum types by name 2023-04-03 11:20:34 -04:00
Mariusz Morawski
513e14f1d6
improvement: Add missing definition for Ash.Type.Time type (#64) 2023-04-03 11:10:55 -04:00
Zach Daniel
c711fa2e9d improvement: add tests & improve behavior of update managed relationships 2023-03-21 23:43:43 -04:00