Commit graph

109 commits

Author SHA1 Message Date
Zach Daniel
1d69d8ef33 fix: support aggregates over calculations 2023-08-29 21:32:22 -04:00
Alan Heywood
0c869aa522
test: add failing test for an aggregate of a calculation (#92)
An error occurs at compile time:

== Compilation error in file test/support/schema.ex ==
** (MatchError) no match of right hand side value: {:error, "Must provide field type for max"}
    lib/resource/resource.ex:2278: AshGraphql.Resource.filterable?/2
    (elixir 1.15.4) lib/enum.ex:4265: Enum.filter_list/2
    (elixir 1.15.4) lib/enum.ex:4266: Enum.filter_list/2
    lib/resource/resource.ex:2229: AshGraphql.Resource.aggregate_filter_fields/2
    lib/resource/resource.ex:2195: AshGraphql.Resource.resource_filter_fields/2
    lib/resource/resource.ex:1159: AshGraphql.Resource.args/5
    lib/resource/resource.ex:425: anonymous fn/6 in AshGraphql.Resource.queries/5
    (elixir 1.15.4) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
2023-08-29 21:30:06 -04:00
Zach Daniel
39e33ca162 chore: fix testing type 2023-08-28 16:15:58 -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
7e46a627b8 chore: format 2023-07-31 15:32:02 -04:00
Zach Daniel
fe85aab53a fix: properly display forbidden field errors
fixes #84
2023-07-13 09:23:17 -04:00
Barnabas Jovanovics
e11deb07aa
test: update field policy test (#83) 2023-07-13 08:46:26 -04:00
Zach Daniel
60517e6e20 chore: update tests, the fix is in main, just need to wait for release 2023-06-28 14:35:18 -04:00
Barnabas Jovanovics
14a5898958
test: add test for loading stuff through unions with fragments (#81) 2023-06-28 11:14:50 -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
Barnabas Jovanovics
7f504bbf17
test: add engine deadlock test (#78) 2023-06-16 10:51:50 -04:00
Zach Daniel
1f6e87ff01 fix: properly resolve arrays of unions from calculations 2023-06-15 13:04:45 -04:00
Barnabas Jovanovics
6c073e746d
test: add new calculate union tests with real resources (#77) 2023-06-15 10:36:20 -04:00
Zach Daniel
045426c629 fix: account for lists of newtype unions 2023-06-14 10:21:20 -04:00
Zach Daniel
74211ef3f4 fix: properly fetch aliased all attributes 2023-06-12 13:19:07 -04:00
Barnabas Jovanovics
dcc7e045b9
test: add tests for graphql aliases (#75) 2023-06-12 10:44:01 -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
28f231f2e0 test: update tests 2023-06-02 13:54:09 -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
7022585ec5 chore: credo 2023-05-15 09:40:35 -04:00
Barnabas Jovanovics
48392115e0
feat: create types for maps with constraints (#68) 2023-05-15 09:39:32 -04:00
Alan Heywood
d89a14175c
improvement: support manual relationships (#66) 2023-04-13 01:42:45 -04:00
Zach Daniel
c711fa2e9d improvement: add tests & improve behavior of update managed relationships 2023-03-21 23:43:43 -04:00
Zach Daniel
b8b5b61786 improvement: supply arguments to relationships on loading 2023-03-17 14:56:06 -04:00
Zach Daniel
3cc3c32f45 improvement: add support for Ash.Type.NewType 2023-03-13 18:32:36 -04:00
Barnabas Jovanovics
e6aadc1221
fix: always return a list from pkey_fields (#59) 2023-02-24 10:00:00 -05:00
Zach Daniel
f1d4c1a3cb improvement: better tagged union handling 2023-02-16 23:33:54 -05:00
Zach Daniel
cf8267123e improvement: support new union types in ash 2023-02-15 08:20:35 -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
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
449ae90db8 fix: properly delete environment on exit 2023-01-18 23:14:08 -05:00
Alan Heywood
d9e17ed42b
fix: map uuid action arguments to ID type (#52) 2023-01-18 19:07:53 -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
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
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
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
1d31f7a20c chore: stop all resources in update_test.exs cleanup 2022-09-28 02:57:23 -04:00