Commit graph

398 commits

Author SHA1 Message Date
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
c6db0fce48 improvement: add AshGraphql.Type 2023-09-28 15:47:03 -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
1950581f83 chore: attempt to fix an issue w/ incorrect action call 2023-09-17 19:17:13 -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
bce89e985c
feat: add more sort order values (#91) 2023-08-28 10:42:39 -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
8f9e79e273 fix: pass arguments to related read action 2023-08-03 19:49:59 -04:00
Zach Daniel
d5e8781abf fix: recurse through array types for union checking 2023-07-31 22:14:11 -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
fe85aab53a fix: properly display forbidden field errors
fixes #84
2023-07-13 09:23:17 -04:00
Jeremy Grant
682a240aa9
fix: {:array, UnionType} issues resolving embedded types (#82) 2023-07-03 23:42:40 -04:00
Zach Daniel
61003d539a chore: update fix with exception for embedded resources 2023-06-28 10:52:23 -04:00
Zach Daniel
eb6d4f24f7 fix: only include types for actions being used by ash_graphql 2023-06-28 10:20:59 -04:00
Zach Daniel
d2f1f321f6 fix: handle detection of fields nested in aliases 2023-06-23 10:53:24 -04:00
Zach Daniel
bb96354470 improvement: support ForbiddenField 2023-06-23 10:10:39 -04:00
Alan Heywood
1c9c173631
fix: fix Logger deprecations for elixir 1.15 (#79)
Use Logger.warning instead of Logger.warn, which is deprecated
2023-06-22 17:38:24 -04:00
Zach Daniel
c70e7dec7d improvement: use parse_input for filters 2023-06-19 15:09:32 -04:00
Zach Daniel
1f6e87ff01 fix: properly resolve arrays of unions from calculations 2023-06-15 13:04:45 -04:00
Zach Daniel
045426c629 fix: account for lists of newtype unions 2023-06-14 10:21:20 -04:00
Zach Daniel
102bf96221 improvement: use new can_load?/2 2023-06-12 16:59:05 -04:00
Zach Daniel
74211ef3f4 fix: properly fetch aliased all attributes 2023-06-12 13:19:07 -04:00
Zach Daniel
3570c477f0 improvement: finalize Subscription.query_for_subscription args 2023-06-09 12:01:21 -04:00
Zach Daniel
087579a062 fix: fixes for resolvers 2023-06-09 10:19:31 -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
e7f7cfc133 fix: ensure forbidden errors always use forbidden code 2023-06-05 17:19:49 -04:00
Zach Daniel
0caf5365f7 improvement: use Ash.Changeset.load 2023-06-05 14:04:53 -04:00
Zach Daniel
a00c55c749 improvement: load calculations using Ash.Query.load 2023-06-05 10:41:36 -04:00
Zach Daniel
d8cf992370 improvement: set actor when building loaded read query 2023-06-04 16:09:55 -04:00
Zach Daniel
000809b34f improvement: graphql_rename_value/1 for enums
docs: union guide & improved enum guide
2023-05-23 17:11:58 -04:00
Zach Daniel
d8b73b56e4 fix: properly use primary read as default read_action 2023-05-22 16:20:46 -04:00
Zach Daniel
20ce8b505e fix: properly thread read action arguments through on updates 2023-05-19 18:01:33 -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
Zach Daniel
7e8c02343c chore: remove inspect 2023-05-01 18:47:14 -04:00
Zach Daniel
cccac9034a improvement: handle nil values in union types 2023-05-01 18:38:58 -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
0a6051469f chore: remove TODO 2023-04-23 07:03:26 -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
Alan Heywood
d89a14175c
improvement: support manual relationships (#66) 2023-04-13 01:42:45 -04:00
bcksl
31315db6f9
improvement: thread context from PlugHelpers.get_context through to Query and Changeset (#62) 2023-04-05 10:39:12 -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
Zach Daniel
fc1433170e improvement: include primary key when managed relationship can update 2023-03-21 23:20:15 -04:00
Zach Daniel
e4dda5a3d9 improvement: don't add types for resources w/o a GQL type
docs: add config to getting started
2023-03-21 23:06:58 -04:00
Zach Daniel
425aee20fe chore: fix sobelow 2023-03-21 21:27:07 -04:00
Zach Daniel
1bea680af3 feat: change type name generation for managed relationships.
The current type name generation could result in clashes.
We now show a warning explaining how to fix these.
2023-03-21 21:17:53 -04:00
Zach Daniel
8159e466e7 fix: properly handle nested argument casting 2023-03-21 16:15:25 -04:00
Zach Daniel
bad0357558 fix: only specify page option if actions upports it 2023-03-20 10:10:49 -04:00
Zach Daniel
b8b5b61786 improvement: supply arguments to relationships on loading 2023-03-17 14:56:06 -04:00
Zach Daniel
d86f6601fb fix: properly filter enum types 2023-03-13 19:13:35 -04:00
Zach Daniel
3cc3c32f45 improvement: add support for Ash.Type.NewType 2023-03-13 18:32:36 -04:00
George Anderson
c0dcd211e7
fix: Typo in name causing Error (#60) 2023-03-03 17:54:45 -05:00
Zach Daniel
9d007a8401 chore: format 2023-02-24 10:00:39 -05:00
Barnabas Jovanovics
e6aadc1221
fix: always return a list from pkey_fields (#59) 2023-02-24 10:00:00 -05:00
Zach Daniel
99a1bfcb8c fix: don't raise on errors reading underlying record 2023-02-22 16:40:20 -05:00
Zach Daniel
4e3acbc87d fix: typo on handle_arguments 2023-02-22 16:36:21 -05:00
Zach Daniel
7083a8363b improvement: build inputs for the underlying get action 2023-02-22 16:25:21 -05:00
Zach Daniel
9d2dcc49d9 fix: never resolve an already resolved field 2023-02-22 13:18:19 -05:00
Zach Daniel
80c3755860 fix: don't run mutations when they've been resolved 2023-02-22 13:13:42 -05:00
Zach Daniel
443e5fd680 improvement: add action_middleware option 2023-02-22 12:19:50 -05:00
Zach Daniel
4c26944f73 fix: don't traverse nested types for auto enums 2023-02-21 08:51:35 -05:00
Zach Daniel
4d08ea500f fix: don't run resolvers if already been resolved 2023-02-20 12:48:32 -05:00
Zach Daniel
f1d4c1a3cb improvement: better tagged union handling 2023-02-16 23:33:54 -05:00
Zach Daniel
800b7eb25d fix: properly use the nested type name for union inputs 2023-02-15 19:39:41 -05:00
Zach Daniel
e15b90e009 fix: properly traverse all embedded/enum types 2023-02-15 15:10:22 -05:00
Zach Daniel
b0fc800079 fix: generate proper type name for union inputs 2023-02-15 13:58:53 -05:00
Zach Daniel
ef5559ed51 fix: infinite recursion in filterability checking 2023-02-15 13:37:55 -05:00
Zach Daniel
80ee34de81 fix: pass down attribute for union type generation 2023-02-15 12:03:57 -05:00
Zach Daniel
cf8267123e improvement: support new union types in ash 2023-02-15 08:20:35 -05:00
Zach Daniel
2a81c185c0 fix: bad error message on missing actions
closes #56
2023-02-13 13:42:44 -05:00
Zach Daniel
f40317f014 doc: add moduledocs for AshGraphql.Errors 2023-02-10 20:02:38 -05:00
Zach Daniel
913afc6d58 improvement: add AshGraphql.Errors.to_errors/3 2023-02-10 20:02:17 -05:00
Zach Daniel
7bb2387fb8 fix: don't try to get metadata out of an error 2023-02-10 11:34:25 -05:00
Zach Daniel
fbebb21d18 fix: ensure types are compiled when checking for enum 2023-02-09 01:23:41 -05:00
Zach Daniel
79b12ddcec fix: properly fetch all global enum types 2023-02-09 01:00:36 -05:00
Zach Daniel
3c7c14c065 docs: add AshGraphql to docs 2023-02-08 22:59:20 -05:00
Zach Daniel
d83dacae54 improvement: make filter & sort generation optional 2023-02-08 15:16:40 -05:00
Zach Daniel
18e5f86fde improvement: add more? (as has_next_page) to pagination info 2023-02-08 11:16:48 -05:00
Zach Daniel
4b90308173 chore: CI/dialyzer 2023-01-28 13:02:21 -05:00
Zach Daniel
f0836f18b6 improvement: support metadata on read actions
metadata on read actions is merged with the rest of the fields on the query, so must have a name unique from the attributes/calculations/aggregates.

The system will warn you if there is metadata on the underlying action that is being ignored, and will tell you how to fix it.
2023-01-28 12:32:21 -05:00
Zach Daniel
839bdcb126 improvement: unwrap forbidden errors, instead of reporting on the whole 2023-01-27 17:11:36 -05:00
Alan Heywood
d9e17ed42b
fix: map uuid action arguments to ID type (#52) 2023-01-18 19:07:53 -05:00
Zach Daniel
5901cd650a improvement: update ash and use new docs patterns 2023-01-18 01:10:40 -05:00
Zach Daniel
c0f5f596cb improvement: better error on empty input objects for managed relationships
closes #50
2023-01-09 19:55:35 -05:00
Zach Daniel
a58f3c998e fix: properly generate enum for atom attributes w/ one_of constraint again
closes #49
2023-01-03 10:13:17 -05:00
Zach Daniel
36c70d2f93 improvement: log stacktraces on raised errors 2023-01-03 09:14:08 -05:00
Zach Daniel
c62d1d50ea docs: fix docs example 2022-12-29 23:38:42 -05:00
Zach Daniel
325ce9c6be improvement: better error message on no type match 2022-12-29 23:36:55 -05:00
Zach Daniel
f259016455 improvement: support naive_datetime out of the box 2022-12-29 23:27:48 -05:00
Zach Daniel
5a6bc0cd1d fix: show all errors on show_raised_errors 2022-12-13 17:47:58 -05:00
Zach Daniel
59cb6bae41 improvement: set error on tracer when an exception is raised 2022-12-09 23:22:42 -05:00
Zach Daniel
fcfad512c5 improvement: update to latest ash, fix incorrect behaviour 2022-11-25 14:28:48 -05:00
Zach Daniel
1b3f43391d improvement: support ash tracers and telemetry in graphql 2022-11-22 13:27:53 -05:00
Zach Daniel
689b0db421 improvement: update to new docs 2022-11-03 09:51:12 -07:00
Yousef Janajri
1985bfc497
improvement: Add Ash.Error.Changes.InvalidChanges AshGraphql implementation (#46) 2022-11-01 22:08:35 -04:00
Zach Daniel
48e6271d0d fix: don't set mutation block if no mutations exist 2022-11-01 21:58:41 -04:00
Zach Daniel
c650126819 fix: resolve issues compiling resources with no type
fix: adding an empty query block is apparently problematic?
2022-10-31 13:07:57 -04:00
James Harton
57e42cac6b
feat(AshGraphql.Plug): Support standard actor/tenant configuration. (#43) 2022-10-30 17:49:24 -04:00
Zach Daniel
9ff395711e improvement: handle keyset & offset pagination when combined on an action (by preferring keyset)
improvement: use new `depend_on_resources/` from Ash to remove the need for registry in schema
fix: various pagination fixes
2022-10-21 08:51:31 -04:00
Zach Daniel
c5662e90ba improvement: validate that relay? queries use keyset?: true actions
improvement: only add `count` to pages when one relevant query is countable
2022-10-21 07:38:33 -04:00
Zach Daniel
3be18011ea chore: fix CI from last commit 2022-10-20 17:57:37 -04:00
Zach Daniel
07e0c6170c improvement: split keyset_page_of and page_of types
improvement: add `start_keyset` and `end_keyset` to `keyset_page_of` type
improvement: add `count` to relay fields if there exists a countable relay query
2022-10-20 17:57:27 -04:00
Zach Daniel
b1bdc49ec5 fix: reference schema not generated module when adding types 2022-10-20 15:03:13 -04:00
Zach Daniel
75ba47215d improvement: change calculation input type name 2022-10-13 00:53:23 -04:00
Zach Daniel
9cc9da0f2e improvement: support calculation sort input
closes #31
2022-10-12 21:15:42 -04:00
Zach Daniel
3a11d988ab improvement: support encode_primary_key? false, and set single managed relationship primary keys do :id type when its true
closes #28
2022-10-12 19:02:04 -04:00
Zach Daniel
195ec3cd4f fix: handle empty root query/root mutation blocks
closes: #10
2022-10-12 17:25:33 -04:00
Zach Daniel
8d79fd7d2a fix: non relay keyset pagination was broken when relay was introduced 2022-10-12 12:11:51 -04:00
Zach Daniel
9a3136fd5d improvement: remove stacktraces? option
improvement: add error handler
improvement: translatable error messages
docs: handle errors guide
2022-10-12 00:51:01 -04:00
Zach Daniel
056e457522 improvement: support only exposing a subset of public relationships 2022-10-11 15:37:19 -04:00
Zach Daniel
7de4207de4 improvement: add upsert_identity option 2022-10-09 21:05:58 -04:00
Zach Daniel
a873dfd685 fix: support determining a type for resource calculations 2022-10-03 12:00:28 -04:00
Zach Daniel
57f6315a9a chore: raise on missing mutation 2022-09-29 15:38:38 -04:00
Zach Daniel
43c636253a fix: raise error on missing query action 2022-09-29 15:29:21 -04:00
Zach Daniel
41ff7bf9aa improvement: handle generated nil filters better 2022-09-26 21:07:41 -04:00
Zach Daniel
92631f91b6 improvement: add options for remapping field/argument names
fix: use the dataloader for loading calculations, to allow for aliases
2022-09-26 00:12:10 -04:00
Zach Daniel
9095a5ae45 improvement: add attribute_types and attribute_input_types
improvement: require configuration of datetime types
2022-09-22 13:31:40 -04:00
Zach Daniel
d859026ddb fix: only create sort input if type is set 2022-09-21 16:28:20 -04:00
Maxim Martynov
e40e7c573c
improvement: Implement GraphQL Relay support (#36) 2022-09-20 23:07:30 -04:00
Zach Daniel
b2b9e22f7c fix: don't generate duplicate types 2022-09-14 16:50:35 -04:00
Zach Daniel
378892e387 improvement: support latest ash 2022-09-14 12:46:12 -04:00
Zach Daniel
d70c68eed9 fix: error when selecting only the count for pagination 2022-09-12 12:23:58 -04:00
Zach Daniel
c3b63430f9 fix: reference proper modules in doc index 2022-08-30 19:33:11 -06:00
Zach Daniel
f4cb9213b3 update to latest ash 2022-08-30 19:08:16 -06:00
Zach Daniel
a10f61b9b4 improvement: update to latest ash 2022-08-10 17:34:13 -04:00
Zach Daniel
598e9c5616 improvement: handle Page.InvalidKeyset error 2022-05-30 16:46:20 -04:00
Zach Daniel
29909742e2 chore: don't explicitly set type when looking up actions 2022-05-28 21:30:34 -04:00
Zach Daniel
c717ad1ade chore: don't explicitly set type when validating action 2022-05-28 21:26:58 -04:00
Frank Dugan III
13c2abe11a
feat: add policy breakdowns option (#35) 2022-05-24 16:42:40 -04:00
Zach Daniel
0a241cb26e fix: update to latest ash and use new interval type 2022-05-23 16:33:27 -04:00