Skip to content

Commit ffed89b

Browse files
authored
feat(drupal): #1299: Drupal 10 Readiness (#1300)
1 parent dedd45c commit ffed89b

File tree

13 files changed

+33
-27
lines changed

13 files changed

+33
-27
lines changed

assets/explorer/dist/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/explorer/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Explorer from './Explorer';
1010
*/
1111
Drupal.behaviors.graphQLRenderExplorer = {
1212
attach: (context, settings) => {
13-
const container = jQuery('#graphql-explorer', context).once('graphql-explorer')[0] || undefined;
13+
const container = jQuery(once('graphql-explorer', '#graphql-explorer', context))[0] || undefined;
1414

1515
if (typeof container === 'undefined') {
1616
return;

assets/voyager/dist/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/voyager/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"lint": "eslint src"
77
},
88
"dependencies": {
9+
"@drupal/once": "^1.0.1",
910
"graphql": "^15.5.1",
1011
"graphql-voyager": "^1.0.0-rc.27",
1112
"react": "^16.3",

assets/voyager/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import ReactDOM from 'react-dom';
33
import { Voyager } from 'graphql-voyager';
44
import Drupal from 'drupal';
55
import jQuery from 'jquery';
6+
import once from '@drupal/once';
67

78
/**
89
* Behavior for rendering the GraphQL Voyager interface.
910
*/
1011
Drupal.behaviors.graphQLRenderVoyager = {
1112
attach: (context, settings) => {
12-
const container = jQuery('#graphql-voyager', context).once('graphql-voyager')[0] || undefined;
13+
const container = jQuery(once('graphql-voyager', '#graphql-voyager', context))[0] || undefined;
1314

1415
if (typeof container === 'undefined') {
1516
return;

assets/voyager/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f"
100100
integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==
101101

102+
"@drupal/once@^1.0.1":
103+
version "1.0.1"
104+
resolved "https://registry.yarnpkg.com/@drupal/once/-/once-1.0.1.tgz#7c1ef480aec6d5fa4b5ae986afa5a607afc38482"
105+
integrity sha512-O8tQmNDBgSm3ADuFZ5OZlGxsrdsc+pEqd1NBoMpSzWwiOnWwC91tqDwnlX+mDh7sBJoJ+4vVwFh0NLUV4LPFvg==
106+
102107
"@eslint/eslintrc@^1.1.0":
103108
version "1.1.0"
104109
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.1.0.tgz#583d12dbec5d4f22f333f9669f7d0b7c7815b4d3"

graphql.libraries.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ explorer:
99
dependencies:
1010
- core/drupal
1111
- core/jquery
12-
- core/jquery.once
12+
- core/once
1313

1414
voyager:
1515
version: VERSION
@@ -23,7 +23,7 @@ voyager:
2323
dependencies:
2424
- core/drupal
2525
- core/jquery
26-
- core/jquery.once
26+
- core/once
2727

2828
persisted_queries:
2929
version: VERSION
@@ -32,4 +32,4 @@ persisted_queries:
3232
dependencies:
3333
- core/drupal
3434
- core/jquery
35-
- core/jquery.once
35+
- core/once

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ parameters:
2525
# that.
2626
- "#^Access to an undefined property Drupal\\\\#"
2727
# PHPUnit deprecation warnings in Drupal 9 that we don't care about.
28-
- "#^Call to deprecated method setMethods\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder:#"
2928
- "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
3029
# Drupal allows object property access to custom fields, so we cannot fix
3130
# that.

tests/src/Kernel/Framework/BufferedFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function setUp(): void {
4343
*/
4444
public function testBatchedFields(): void {
4545
$buffer = $this->getMockBuilder(BufferBase::class)
46-
->setMethods(['resolveBufferArray'])
46+
->onlyMethods(['resolveBufferArray'])
4747
->getMock();
4848

4949
$users = [

tests/src/Kernel/Framework/DisabledResultCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testDisabledCache(): void {
4949

5050
$object = $this->getMockBuilder(Server::class)
5151
->disableOriginalConstructor()
52-
->setMethods(['id'])
52+
->onlyMethods(['id'])
5353
->getMock();
5454

5555
$object->expects($this->exactly(2))

0 commit comments

Comments
 (0)