Skip to content

Commit

Permalink
Merge branch 'main' into fix/dont-cast-arrays-as-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine committed Apr 5, 2024
2 parents f5045e4 + 5e2e272 commit cf3d271
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 47 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-pans-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": patch
---

fix: Change Block:get_block_attribute_fields()`$prefix parameter be an optional`string`.
13 changes: 6 additions & 7 deletions .github/workflows/upload-schema-artifact.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Upload Schema Artifact

on:
workflow_run:
workflows: ["Release"]
types:
- completed
push:
tags:
- "*"

jobs:
run:
Expand All @@ -22,8 +21,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup WordPress
uses: ./.github/actions/setup-wordpress

Expand All @@ -34,8 +32,9 @@ jobs:
wp graphql generate-static-schema
- name: Upload schema as release artifact
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ format('v{0}',github.ref_name)}}
files: /tmp/schema.graphql
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ docker-compose.override.yml

# Built Zip
@wpengine

# Ignore WordPress sorce directory
wordpress/

# Ignore config file from Kana development environment
.kana.json
6 changes: 3 additions & 3 deletions includes/Blocks/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ private function get_attribute_type( $name, $attribute, $prefix ) {
/**
* Gets the WPGraphQL field registration config for the block attributes.
*
* @param ?array $block_attributes The block attributes.
* @param string|null $prefix The current prefix string to use for the get_query_type
* @param ?array $block_attributes The block attributes.
* @param string $prefix The current prefix string to use for the get_query_type
*/
private function get_block_attribute_fields( ?array $block_attributes, $prefix = '' ): array {
private function get_block_attribute_fields( ?array $block_attributes, string $prefix = '' ): array {
$fields = [];

// Bail early if no attributes are defined.
Expand Down
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ parameters:
count: 1
path: includes/Blocks/Block.php

-
message: "#^Parameter \\#3 \\$prefix of method WPGraphQL\\\\ContentBlocks\\\\Blocks\\\\Block\\:\\:get_attribute_type\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: includes/Blocks/Block.php

-
message: "#^Call to an undefined method DiDom\\\\Element\\|DOMElement\\:\\:html\\(\\)\\.$#"
count: 1
Expand Down

0 comments on commit cf3d271

Please sign in to comment.