Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL 4.x port #40

Open
wants to merge 10 commits into
base: 8.x-1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check coding styles

on: [pull_request]

jobs:
phpcs:
name: runner / phpcs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: phpcs
uses: chrfritsch/action-drupal-coder@v1
with:
github_token: ${{ secrets.github_token }}
level: error
filter_mode: nofilter

misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-check
level: warning
locale: "US"
81 changes: 81 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Run module tests

on:
pull_request:
paths-ignore:
- '**.md'

schedule:
- cron: '0 6 * * *'

env:
DRUPAL_TESTING_TEST_CODING_STYLES: false
DRUPAL_TESTING_DATABASE_USER: root
DRUPAL_TESTING_DATABASE_PASSWORD: root
DRUPAL_TESTING_DATABASE_ENGINE: mysql
DRUPAL_TESTING_HTTP_PORT: 8888

jobs:
build:

runs-on: ubuntu-20.04

strategy:
matrix:
DRUPAL_TESTING_DRUPAL_VERSION: ['~8.9.0', '~9.1.0']
PHP_VERSION: [ '7.4' ]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '12.x'

- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.PHP_VERSION }}
extensions: Imagick, gd, pdo_mysql

- name: Start MySql service
run: |
sudo /etc/init.d/mysql start
mysql -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-cache-

- name: Get build environment
run: composer global require thunder/drupal-testing

- name: Prepare the build
run: test-drupal-project prepare_build
env:
DRUPAL_TESTING_DRUPAL_VERSION: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION }}

- name: Build the docroot
run: test-drupal-project build

- name: Test for deprecations
run: test-drupal-project deprecation
if: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION != '~9.1.0' }}

- name: Install drupal
run: test-drupal-project install
env:
DRUPAL_TESTING_TEST_DEPRECATION: false

- name: Setup Apache
uses: thunder/apache-shiva-php-action@v1
with:
php-version: ${{ matrix.PHP_VERSION }}
site-directory: /tmp/test/graphql-views/install/web
http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }}

- name: Run the tests
run: test-drupal-project
6 changes: 0 additions & 6 deletions .scrutinizer.yml

This file was deleted.

118 changes: 0 additions & 118 deletions .travis.yml

This file was deleted.

13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
# GraphQL Views for Drupal

[![Build Status](https://img.shields.io/travis/drupal-graphql/graphql-views.svg)](https://travis-ci.org/drupal-graphql/graphql-views)
[![Code Coverage](https://img.shields.io/codecov/c/github/drupal-graphql/graphql-views.svg)](https://codecov.io/gh/drupal-graphql/graphql-views)
[![Code Quality](https://img.shields.io/scrutinizer/g/drupal-graphql/graphql-views.svg)](https://scrutinizer-ci.com/g/drupal-graphql/graphql-views/?branch=8.x-1.x)
[![Build Status](https://github.com/drupal-graphql/graphql-views/workflows/.github/workflows/test.yml/badge.svg)](https://github.com/drupal-graphql/graphql-views/actions)

[Drupal GraphQL]: https://github.com/drupal-graphql/graphql

With `graphql_views` enabled a `GraphQL` views display can be added to any view in the system.

Results can be sorted, filtered based on content fields, and relationships can be added. There is also the option to return either the full entities, just a selection of fields, or even search results taken straight from a search server.
Results can be sorted, filtered based on content fields, and relationships can be added.

Any `GraphQL` views display will provide a field that will adapt to the views configuration:

- The fields name will be composed of the views and displays machine names or configured manually.
- If the view is configured with pagination, the field will accept pager arguments and return the result list and count field instead of the entity list directly.
- Any exposed filters will be added to the `filters` input type that can be used to pass filter values into the view.
- Any contextual filters will be added to the `contextual_filters` input type.
- If a contextual filters validation criteria match an existing GraphQL type, the field will be added to this type too, and the value will be populated from the current result context.

Read more on:
- https://www.amazeelabs.com/en/blog/graphql-drupalers-part-4-fetching-entities
- https://www.amazeelabs.com/en/blog/drupal-graphql-batteries-included

Please also refer to the main [Drupal GraphQL] module for further information.
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "drupal/graphql_views",
"type": "drupal-module",
"description": "Exposes your Drupal Views data model through a GraphQL schema.",
"homepage": "http://drupal.org/project/graphql_views",
"license": "GPL-2.0+",
"minimum-stability": "dev"
"name": "drupal/graphql_views",
"type": "drupal-module",
"description": "Exposes your Drupal Views data model through a GraphQL schema.",
"homepage": "http://drupal.org/project/graphql_views",
"license": "GPL-2.0+",
"minimum-stability": "dev",
"require": {
"drupal/graphql": "^4.1"
}
}
4 changes: 0 additions & 4 deletions config/schema/graphql_views.views.schema.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
views.display.graphql:
type: views_display
label: 'GraphQL display options'
mapping:
graphql_query_name:
type: string
label: 'GraphQL query name'
6 changes: 2 additions & 4 deletions graphql_views.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: GraphQL Views
type: module
description: 'Adds support for views.'
package: GraphQL
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8.9 || ^9
dependencies:
- graphql:graphql_core
- drupal:graphql
- drupal:views
- drupal:system (>=8.4)
16 changes: 0 additions & 16 deletions phpcs.xml.dist

This file was deleted.

51 changes: 0 additions & 51 deletions src/Plugin/Deriver/Enums/ViewSortByDeriver.php

This file was deleted.

Loading