Skip to content

Commit

Permalink
Merge pull request #142 from wp-graphql/feat/prep-for-plugin-repo
Browse files Browse the repository at this point in the history
chore: prep for launch on the .org repo
  • Loading branch information
jasonbahl authored Dec 19, 2023
2 parents 157e947 + a78dd0b commit 114a2fe
Show file tree
Hide file tree
Showing 42 changed files with 413 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MYSQL_PASSWORD=${DB_PASSWORD}
WP_VERSION=6.1
PHP_VERSION=8.0
WPGRAPHQL_VERSION=latest
DATA_DUMP_DIR=/var/www/html/wp-content/plugins/wp-graphql-acf/tests/_data
DATA_DUMP_DIR=/var/www/html/wp-content/plugins/wpgraphql-acf/tests/_data

# Define the version of ACF to test with
ACF_VERSION="latest"
Expand Down
2 changes: 1 addition & 1 deletion .env.testing.dist
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ MYSQL_PASSWORD=${DB_PASSWORD}
WP_VERSION=6.1
PHP_VERSION=8.0
WPGRAPHQL_VERSION=latest
DATA_DUMP_DIR=/var/www/html/wp-content/plugins/wp-graphql-acf/tests/_data
DATA_DUMP_DIR=/var/www/html/wp-content/plugins/wpgraphql-acf/tests/_data
DOCKER_REGISTRY=ghcr.io/wp-graphql/

# Define the test suites to run
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
Please remember, a bug report is not the place to ask questions. You can
use [Slack](https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA) for that, or start a topic in [GitHub
Discussions](https://github.com/wp-graphql/wp-graphql/discussions).
Discussions](https://github.com/wp-graphql/wpgraphql-acf/discussions).
- type: textarea
attributes:
label: Description
Expand All @@ -35,8 +35,8 @@ body:
attributes:
label: PHP or JSON export of the ACF Field Group(s)
description: >-
Paste or attach the PHP or JSON export of the ACF Field Group(s) related to the problem.
Paste or attach the PHP or JSON export of the ACF Field Group(s) related to the problem.
Attach as Github supported file type, ie .txt or .zip
- type: textarea
attributes:
Expand Down Expand Up @@ -76,7 +76,7 @@ body:
attributes:
label: Please confirm that you have searched existing issues in the repo.
description: >-
You can do this by searching https://github.com/wp-graphql/wp-graphql/issues.
You can do this by searching https://github.com/wp-graphql/wpgraphql-acf/issues and https://github.com/wp-graphql/wp-graphql/issues.
options:
- label: 'Yes'
required: true
Expand Down
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: General Help Request
url: https://github.com/wp-graphql/wpgraphql-acf/discussions
about: For general questions and help requests, create a new topic in Github Discussions
- name: Slack Community
url: https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA
about: The WPGraphQL Slack is a great place to communicate in real-time. Ask questions, discuss features, get to know other folks using WPGraphQL.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
Please make sure to search the repo for [existing feature
requests](https://github.com/wp-graphql/wp-graphql-acf/issues)
requests](https://github.com/wp-graphql/wpgraphql-acf/issues)
before creating a new one.
- type: textarea
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schema-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
echo "Previous tagged schema ${{ steps.get-latest-tag.outputs.tag }}"
- name: Get Previous Released Schema
run: curl 'https://github.com/wp-graphql/wp-graphql-acf-2/releases/download/${{ steps.get-latest-tag.outputs.tag }}/schema.graphql' -L --output /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql
run: curl 'https://github.com/wp-graphql/wpgraphql-acf/releases/download/${{ steps.get-latest-tag.outputs.tag }}/schema.graphql' -L --output /tmp/${{ steps.get-latest-tag.outputs.tag }}.graphql

# https://github.com/marketplace/actions/graphql-inspector
- name: Install Schema Inspector
Expand Down
Binary file modified .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .wordpress-org/screenshot-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.0

- [#142](https://github.com/wp-graphql/wpgraphql-acf/pull/142): Update README, versions, plugin assets for deploy to WordPress.org.

## 2.0.0-beta.7.0.0

### BREAKING CHANGES
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## WordPress Site

The `app` docker image starts a running WordPress site with the local wp-graphql-acf directory installed and activated. Local changes to the source code is immediately reflects in the app.
The `app` docker image starts a running WordPress site with the local wpgraphql-acf directory installed and activated. Local changes to the source code is immediately reflects in the app.

1. Build the plugin.
1.1 `composer install` or `docker run -v $PWD:/app composer --ignore-platform-reqs install`
Expand Down Expand Up @@ -66,7 +66,7 @@ If you have WordPress core files in a directory for local development, you can a
"show_hidden": 1
},
"pathMappings": {
"/var/www/html/wp-content/plugins/wp-graphql-acf": "${workspaceFolder}",
"/var/www/html/wp-content/plugins/wpgraphql-acf": "${workspaceFolder}",
"/var/www/html/wp-content/plugins/wp-graphql": "${workspaceFolder}../wp-graphql",
"/var/www/html": "${workspaceFolder}/wordpress",
}
Expand Down
105 changes: 90 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@
# WPGraphQL for Advanced Custom Fields (BETA)
# WPGraphQL for Advanced Custom Fields

This plugin is a replacement for WPGraphQL for ACF, found here: https://github.com/wp-graphql/wp-graphql-acf
WPGraphQL for Advanced Custom Fields is a free, open-source WordPress plugin that adds ACF Fields and Field Groups to the WPGraphQL Schema.

## Beta Notice
Development of this plugin has been made possible by [WP Engine Atlas](https://wpengine.com/atlas)

This is beta software. There will be breaking changes as we iterate toward a stable release.
## Table of Contents

- [Upgrade Notice](#upgrade-notice)
- [Plugin Overview](#plugin-overview)
- [Requirements](#requirements)
- [Installation and Activation](#installation-and-activation)
- [How WPGraphQL for ACF maps Field Groups to the Schema](#how-wpgraphql-for-acf-maps-field-groups-to-the-schema)
- [ACF Post Type and Taxonomy Support](#acf-post-type-and-taxonomy-support)
- [FAQs](#faqs)
- [Support](#support)
- [Privacy Policy](#privacy-policy)

## Upgrade Notice

If you were using the previous version of WPGraphQL for ACF (https://github.com/wp-graphql/wp-graphql-acf) this plugin is intended to replace it.
If you are updating from WPGraphQL for ACF v0.6.* or older, check out the [Upgrade Guide](https://acf.wpgraphql.com/upgrade-guide).

## Plugin Overview

They are not intended to be active at the same time.
In short, WPGraphQL for ACF extends the WPGraphQL Schema by adding GraphQL Types, GraphQL Interfaces
and GraphQL fields for accessing data managed by Advanced Custom Fields.

We will work on a more in-depth upgrade guide, but for now we recommend de-activating the previous plugin before activating this one, then testing your client application queries against the Schema and adjusting your queries accordingly.
WPGraphQL for ACF supports the built-in field types in
[Advanced Custom Fields](https://www.advancedcustomfields.com/) free and ACF PRO, as well as
[ACF Extended](https://www.acf-extended.com/) Free and Pro.

There are breaking changes to both code under the hood and the GraphQL Schema that is generated, so be sure to test in environments that are ready to endure these changes.
This plugin extends the ACF Admin UIs to provide settings for adding ACF Post Types, Taxonomies,
Field Groups and Fields to the WPGraphQL Schema. For users that register ACF Field Groups and Fields
using PHP or JSON, you can control how they're mapped to the GraphQL Schema at that level as well.

Stay tuned for a more in-depth upgrade guide.
Under there are various APIs for determining how each ACF Field Type is mapped to the WPGraphQL '
Schema, and resolved when queried for in a GraphQL Query.

## Plugin Overview
The plugin provides hooks and filters, allowing developers to customize the experience and override
default logic.

### Installation and Activation
## Requirements

@todo
- [WPGraphQL](https://wordpress.org/plugins/wp-graphql/) (latest version recommended)
- [Advanced Custom Fields](https://advancedcustomfields.com) Free or PRO (latest version recommended)
- [ACF Extended Free or PRO](https://advancedcustomfields.com) (optional)
- WordPress 6.1+
- PHP 7.4+

### How WPGraphQL for ACF maps Field Groups to the Schema
## Installation and Activation

_@todo: expand this_
See our [Installation and Activation](https://acf.wpgraphql.com/installation-and-activation/) guide.

## How WPGraphQL for ACF maps Field Groups to the Schema

Each ACF Field Group is mapped to the GraphQL Schema with a GraphQL Interface Type and a GraphQL Object Type to represent the field group.

Expand Down Expand Up @@ -77,12 +102,62 @@ And we can use this fragment in various queries, for example:
}
```

### ACF Post Type and Taxonomy Support
## ACF Post Type and Taxonomy Support

Advanced Custom Fields v6.1 added support for registering Post Types and Taxonomies from the WordPress dashboard.

WPGraphQL for ACF allow you to configure the Custom Post Types and Taxonomies to Show in GraphQL and allows you to customize the GraphQL Single Name and GraphQL Plural Name.

## FAQs

### Does this work with ACF Extended?

Yes! WPGraphQL for ACF allows you to query for (most) fields created with ACF Extended.

### Can I filter and sort queries by ACF Fields using WPGraphQL for ACF?

At this time WPGraphQL for ACF does not support filtering or sorting queries by ACF Fields. "Meta Queries" are often very expensive to execute, so we currently do not support filtering by ACF fields out of the box, but are exploring options for supporting it without the performance penalty.

### I think I found a bug, where do I report it?

If you think you found a bug, please open an issue on [GitHub](https://github.com/wp-graphql/wpgraphql-acf). The more details you provide in the issue, and the more clear your steps to reproduce are, the higher chances we will be able to help.

### Can I use ACF Free or Pro with WPGraphQL for ACF?

Yes! WPGraphQL for ACF works great with ACF Free and Pro. The Pro version of ACF has some additional features, such as Flexible Content Fields, Repeater Fields and Options Pages that are supported by WPGraphQL for ACF.

### Do I have to use Faust.js to use WPGraphQL for ACF?

No! While [wpgraphql.com](https://www.wpgraphql.com) and [acf.wpgraphql.com](https://acf.wpgraphql.com) are built using [Faust.js](https://faustjs.org/) and Next.js, you can use WPGraphQL for ACF with any GraphQL client, including Apollo, Relay, Urql, etc.

### I have an ACF Extension that adds a new field type, will it work with WPGraphQL for ACF?

WPGraphQL for ACF supports the field types that come with ACF (Free and PRO) as well as the field types in ACF Extended (Free and PRO). Support for additional field types can be added by using the "register_graphql_acf_field_type" API.

### Do I need WPGraphQL and ACF to be active to use this?

This plugin is a "bridge" plugin that brings functionality of ACF to WPGraphQL. Both WPGraphQL and ACF need to be installed and active in your WordPress installation for this plugin to work.

### How much does WPGraphQL for ACF cost?

WPGraphQL for ACF is a FREE open-source plugin. The development is sponsored by [WP Engine Atlas](https://wpengine.com/atlas).

### Does WPGraphQL for ACF support GraphQL Mutations?

GraphQL Mutations are not yet supported. We are working on adding support for Mutations in the future. We are waiting for the GraphQL "@oneOf" directive to be merged into the GraphQL spec before we add support for Mutations.

### Does this work with Field Groups registered in PHP or JSON?

Yes! You can register ACF Field Groups and Fields using the Admin UI, PHP or JSON. WPGraphQL for ACF will detect the Field Groups and Fields and add them to the GraphQL Schema. If using PHP or JSON, you will need to set the "show_in_graphql" setting to "true" to expose the Field Group and Fields to the GraphQL Schema. There might be other settings that need attention at the field group or field level that might impact the schema or field resolution.

## Support

- [General Help Requests](https://github.com/wp-graphql/wp-graphql/discussions): For general questions and help requests, create a new topic in Github Discussions
- [Slack Community](https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA): The WPGraphQL Slack is a great place to communicate in real-time. Ask questions, discuss features, get to know other folks using WPGraphQL.
- [Bug Reports](https://github.com/wp-graphql/wp-graphql/issues/new?assignees=&labels=&projects=&template=bug_report.yml): Report a bug in WPGraphQL
- [Feature Requests](https://github.com/wp-graphql/wp-graphql/issues/new?assignees=&labels=&projects=&template=feature_request.yml): Suggest an idea, feature, or enhancement for WPGraphQL.
- [Report a Security Vulnerability](https://github.com/wp-graphql/wp-graphql/security/advisories/new): Report a security vulnerability.

## Privacy Policy

WPGraphQL for Advanced Custom Fields uses [Appsero](https://appsero.com) SDK to collect some telemetry data upon user's confirmation. This helps us to troubleshoot problems faster & make product improvements.
Expand Down
6 changes: 3 additions & 3 deletions bin/install-test-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ install_acf_pro() {

setup_plugin() {
# Add this repo as a plugin to the repo
if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql-acf ]; then
ln -s $PLUGIN_DIR $WP_CORE_DIR/wp-content/plugins/wp-graphql-acf
if [ ! -d $WP_CORE_DIR/wp-content/plugins/wpgraphql-acf ]; then
ln -s $PLUGIN_DIR $WP_CORE_DIR/wp-content/plugins/wpgraphql-acf
cd $WP_CORE_DIR/wp-content/plugins
pwd
ls
Expand All @@ -180,7 +180,7 @@ setup_plugin() {
wp plugin activate wp-graphql

# activate the plugin
wp plugin activate wp-graphql-acf
wp plugin activate wpgraphql-acf

# List the active plugins
wp plugin list
Expand Down
6 changes: 3 additions & 3 deletions bin/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ case "$subcommand" in
a )
echo "Build app"
docker build $BUILD_NO_CACHE -f docker/Dockerfile \
-t wp-graphql-acf:${TAG}-wp${WP_VERSION}-php${PHP_VERSION} \
-t wpgraphql-acf:${TAG}-wp${WP_VERSION}-php${PHP_VERSION} \
--build-arg WP_VERSION=${WP_VERSION} \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY} \
Expand All @@ -71,15 +71,15 @@ case "$subcommand" in
t )
echo "Build app"
docker build $BUILD_NO_CACHE -f docker/Dockerfile \
-t wp-graphql-acf:${TAG}-wp${WP_VERSION}-php${PHP_VERSION} \
-t wpgraphql-acf:${TAG}-wp${WP_VERSION}-php${PHP_VERSION} \
--build-arg WP_VERSION=${WP_VERSION} \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY} \
.
echo "Build testing"
source .env.testing
docker build $BUILD_NO_CACHE -f docker/Dockerfile.testing \
-t wp-graphql-acf-testing:${TAG}-wp${WP_VERSION}-php${PHP_VERSION} \
-t wpgraphql-acf-testing:${TAG}-wp${WP_VERSION}-php${PHP_VERSION} \
--build-arg WP_VERSION=${WP_VERSION} \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY} \
Expand Down
8 changes: 4 additions & 4 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ settings:
coverage:
enabled: true
remote: false
c3_url: '%WP_URL%/wp-content/plugins/wp-graphql-acf/wp-graphql-acf.php'
c3_url: '%WP_URL%/wp-content/plugins/wpgraphql-acf/wpgraphql-acf.php'
include:
- src/*
exclude:
- wp-graphql-acf.php
- wpgraphql-acf.php
- vendor/*
show_only_summary: false
extensions:
Expand Down Expand Up @@ -75,12 +75,12 @@ modules:
- '%ACF_PLUGIN_SLUG%'
- '%ACF_EXTENDED_PLUGIN_SLUG%'
- wp-graphql/wp-graphql.php
- wp-graphql-acf/wp-graphql-acf.php
- wpgraphql-acf/wpgraphql-acf.php
- '%WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_SLUG%'
activatePlugins:
- '%ACF_PLUGIN_SLUG%'
- '%ACF_EXTENDED_PLUGIN_SLUG%'
- wp-graphql/wp-graphql.php
- wp-graphql-acf/wp-graphql-acf.php
- wpgraphql-acf/wpgraphql-acf.php
- '%WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_SLUG%'
configFile: 'tests/_data/config.php'
Loading

0 comments on commit 114a2fe

Please sign in to comment.