You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,35 @@
1
1
# Changelog
2
2
3
+
## v0.8.0 - Revamped GraphQL Connections
4
+
5
+
**:warning: This release requires Gravity Forms v2.5.0 or higher. **
6
+
7
+
This release reworks all GraphQL connections, implementing data loaders, optimizing database queries, and adding support for more where args in more situations.
8
+
9
+
### New Features
10
+
-`gravityFormsForms` can now be filtered by a list of form IDs.
11
+
-`FormEntry` connections now have access to the following `where` args: `status`, `dateFilters`, `fieldFilters`, `fieldFiltersMode`.
12
+
-`formField` can now be filtered by a list of field IDs, `adminLabels`, and the field type.
13
+
-[Breaking] Full pagination support has been added to `Forms` and `Entries`. **Note**: cursor generation has changed, so if you are manually generating form or entry cursors, you will need to update your code.
14
+
-[Breaking]`FieldFiltersOperatorInputEnum` now supports all remaining Gravity Forms entry search operators, such as `LIKE`, `IS`, `IS_NOT`. The `GREATER_THAN` and `LESS_THAN` operators have been removed, as they are not supported by Gravity Forms.
15
+
16
+
### Bugfixes
17
+
- Correctly handle `sourceUrl` changes in `submitGravityFormsForm` and `updateGravityFormsDraftEntry` mutations.
18
+
-`wp_graphql_gf_can_view_entries` filter now correctly passes `$form_ids` instead of non-existent `$entry_ids`.
19
+
-`fieldFilters` now correctly search through `array` entry values.
20
+
-`EntriesFieldFiltersInput.key` is now optional.
21
+
22
+
### Under the Hood
23
+
-[Breaking] Bumped minimum GF version to v2.5.x.
24
+
-[Breaking] Connections have been completely refactored. The new classes are `EntryConnections`, `FieldConnections` and `FormConnections`.
25
+
-[Breaking]`RootQueryEntriesConnectionResolver` and `RootQueryFormsConnectionResolver` classes were renamed to `EntriesConnectionsResolver` and `FormConnectionResolver`. They now properly extend `AbstractConnectionResolver`.
26
+
- Form connections now implement a `DataLoader`.
27
+
- Added `GFUtils::get_forms()` for speedy requests from $wpdb.
28
+
- Fixed various code smells.
29
+
- docs: Updated information about queries to reflect pagination and new `where` args.
30
+
- tests: WPUnit tests now extend `GFGraphQLTestCase`.
31
+
- tests: [Breaking]`WPGraphQLGravityForms\Tests` namespace has been renamed to `Tests\WPGraphQL\GravityForms`.
32
+
3
33
## v0.7.3 - WPGraphQL v1.6.x Compatibility
4
34
5
35
This release adds compatibility with WPGraphQL v1.6.x, [and its new lazy/eager type loading](https://github.com/wp-graphql/wp-graphql/releases/tag/v1.6.0).
Copy file name to clipboardExpand all lines: docs/querying-entries.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,17 +75,18 @@ To query a Draft Entry, simply pass the `resumeToken` to the input `id` field, a
75
75
76
76
## Get a List of Entries
77
77
78
-
The code comments in the example query below explain how you can get a filtered list of entries.
78
+
The code comments in the example query below shows how you can fetch and filter data for multiple entries at once.
79
79
80
-
The plugin supports `first, after` and `last, before` cursor-based [pagination](https://www.wpgraphql.com/docs/connections/#solution-for-pagination-naming-conventions-and-contextual-data), but does not support `first, before`or `last, after` pagination. It also does not yet support querying for a list of draft entries.
80
+
[Cursor-based pagination](https://www.wpgraphql.com/docs/connections/#solution-for-pagination-naming-conventions-and-contextual-data) is supported. You can use the `first`, `last`, `before`and `after` fields, along with the data inside of `pageInfo` and the cursors returned by the API to get each page of forms data.
81
81
82
82
By default, WPGraphQL sets the maximum query amount to 100. This can be overwritten using the [`graphql_connection_max_query_amount` filter](https://www.wpgraphql.com/filters/graphql_connection_max_query_amount/).
83
83
84
+
84
85
```graphql
85
86
{
86
87
gravityFormsEntries(
87
88
first: 20
88
-
after: "eyJvZmZzZXQiOjAsImluZGV4Ijo0fQ==" # Or pass null to start from the beginning.
89
+
after: "YXJyYXljb25uZWN0aW9uOjk=" # Or pass null to start from the beginning.
89
90
where: {
90
91
# List of all the form IDs to include.
91
92
formIds: [1]
@@ -102,6 +103,8 @@ By default, WPGraphQL sets the maximum query amount to 100. This can be overwrit
102
103
{ key: "created_by", intValues: [1], operator: IN }
103
104
# Find entries where field 5 has a value of "somevalue".
104
105
{ key: "5", stringValues: [ "somevalue" ], operator: IN }
106
+
# Search all entry meta fields for a value.
107
+
{ stringValues: "somevalue", operator: CONTAINS }
105
108
]
106
109
# Sort fields in ascending order by "date_created"
Copy file name to clipboardExpand all lines: docs/querying-formfields.md
+36-6Lines changed: 36 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
# Querying `formFields` and their values
1
+
# Querying `formFields`
2
2
3
-
Both [forms](https://docs.gravityforms.com/form-object/) and [entries](https://docs.gravityforms.com/entry-object/) use the `formFields`GraphQL Interface to retrieve information about [Gravity Forms fields](https://docs.gravityforms.com/field-object/), and their submission values.
3
+
## Getting the `formFields`from a form or entry.
4
4
5
-
In addition to the shared fields available on the Interface, each GF Field has its own set of GraphQL fields that are accessible with query fragments.
5
+
Both [forms](https://docs.gravityforms.com/form-object/) and [entries](https://docs.gravityforms.com/entry-object/) use the `formFields` GraphQL Interface to retrieve information about [Gravity Forms fields](https://docs.gravityforms.com/field-object/), and their submission values.
6
6
7
-
You can pass `first:300` to `formFields`, where `300` is the maximum number of fields you want to query for.
7
+
In addition to the shared fields available on the Interface, each Gravity Forms Field type has its own set of GraphQL fields that are accessible with query fragments.
8
8
9
-
## Example Query
9
+
###Example Query
10
10
11
11
```graphql
12
12
{
@@ -46,6 +46,8 @@ You can pass `first:300` to `formFields`, where `300` is the maximum number of f
46
46
}
47
47
```
48
48
49
+
## Getting `formField` entry values.
50
+
49
51
Entry values can be accessed similarly to other Gravity Forms Field properties, by including the corresonding GraphQL field in the fragment.
50
52
51
53
**Note**: Due to GraphQL limitations regarding Union types, you must use the specific value type specific to that field. A full list of field value types and their corresponding field fragments are below.
@@ -61,7 +63,7 @@ Entry values can be accessed similarly to other Gravity Forms Field properties,
Copy file name to clipboardExpand all lines: docs/querying-forms.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,20 +35,25 @@ The `id` input accepts either the Gravity Forms form ID (`idType: DATABASE_ID`)
35
35
36
36
## Get a List of Forms.
37
37
38
-
The code comments in the example query below shows how you can fetch data for multiple forms at once.
38
+
The code comments in the example query below shows how you can fetch and filter data for multiple forms at once.
39
39
40
40
[Cursor-based pagination](https://www.wpgraphql.com/docs/connections/#solution-for-pagination-naming-conventions-and-contextual-data) is supported. You can use the `first`, `last`, `before` and `after` fields, along with the data inside of `pageInfo` and the cursors returned by the API to get each page of forms data.
41
41
42
-
Filtering is also supported. For the `where` field, you can specify a `status` to get forms that are active, inactive, in the trash, etc.
43
-
44
42
#### Example Query
45
43
46
44
```graphql
47
45
{
48
46
gravityFormsForms(
49
47
first: 10
50
-
after: "eyJvZmZzZXQiOjAsImluZGV4Ijo0fQ==" # Or pass null to start from the beginning.
51
-
where: { status: ACTIVE }
48
+
after: "YXJyYXljb25uZWN0aW9uOjM=" # Or pass null to start from the beginning.
Copy file name to clipboardExpand all lines: docs/using-global-ids.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Global IDs vs Database IDs
2
2
3
-
The `id` input for Form and Entry queries accepts either the Gravity Forms ID (`idType: DATABASE_ID`) assigned to the WordPress database, or a global (base-64 encoded) ID (`idType: ID`).
3
+
The `id` input for Form and Entry queries accepts either the Gravity Forms ID (`idType: DATABASE_ID`) assigned to the WordPress database, or a global (base-64 encoded) ID (`idType: ID`).
4
4
5
5
To generate global ID for an object, you encode the name of the GraphQL type, followed by the database ID. This can be done in JavaScript using the `btoa()` function like this, where `GravityFormsForm` is the GraphQL type and `1` is the form ID:
6
6
@@ -13,7 +13,7 @@ You can also retrieve the global ID by returning the `id` field on the object.
13
13
The example query below shows how you can use a Global ID as your input, and how you can include the global ID in the query's response:
0 commit comments