Skip to content

Commit

Permalink
Merge pull request #24 from vernaillen/improved-extendable-graphql-qu…
Browse files Browse the repository at this point in the history
…eries

improved & extendable graphql queries
  • Loading branch information
vernaillen authored Mar 2, 2024
2 parents 0b2e685 + 4376251 commit ed0986b
Show file tree
Hide file tree
Showing 55 changed files with 531 additions and 732 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
- run:
name: Lint
command: pnpm run lint
- run:
name: Test
command: pnpm run coverage
- sonarcloud/scan
- slack/notify:
channel: circleci
Expand Down
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,24 @@ playground/.vercel/

wordpress/files/
playground/schema.graphql
playground/queries/Menu.gql
playground/queries/Page.gql
playground/queries/Pages.gql
playground/queries/Post.gql
playground/queries/PostByUri.gql
playground/queries/Posts.gql
playground/queries/Revisions.gql
playground/queries/Settings.gql
playground/queries/Viewer.gql
playground/queries/fragments/ContentNode.fragment.gql
playground/queries/fragments/CoreGallery.fragment.gql
playground/queries/fragments/CoreImage.fragment.gql
playground/queries/fragments/CoreParagraph.fragment.gql
playground/queries/fragments/CoreQuote.fragment.gql
playground/queries/fragments/EditorBlock.fragment.gql
playground/queries/fragments/MediaItem.fragment.gql
playground/queries/fragments/NodeWithExcerpt.fragment.gql
playground/queries/fragments/NodeWithFeaturedImage.fragment.gql
playground/queries/fragments/NodeWithFeaturedImageToMediaItemConnectionEdge.fragment.gql
playground/queries/fragments/Page.fragment.gql
playground/queries/fragments/Post.fragment.gql
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog


## v0.1.30

[compare changes](https://github.com/vernaillen/wpnuxt-module/compare/v0.1.29...v0.1.30)

## v0.1.29

[compare changes](https://github.com/vernaillen/wpnuxt-module/compare/v0.1.28...v0.1.29)
Expand Down
24 changes: 24 additions & 0 deletions examples/custom-posttypes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
75 changes: 75 additions & 0 deletions examples/custom-posttypes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
5 changes: 5 additions & 0 deletions examples/custom-posttypes/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<NuxtWelcome />
</div>
</template>
4 changes: 4 additions & 0 deletions examples/custom-posttypes/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true }
})
17 changes: 17 additions & 0 deletions examples/custom-posttypes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"nuxt": "^3.10.3",
"vue": "^3.4.19",
"vue-router": "^4.3.0"
}
}
Binary file added examples/custom-posttypes/public/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/custom-posttypes/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
4 changes: 4 additions & 0 deletions examples/custom-posttypes/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
24 changes: 24 additions & 0 deletions examples/yoastseo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
75 changes: 75 additions & 0 deletions examples/yoastseo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nuxt 3 Minimal Starter

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

## Setup

Make sure to install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

## Development Server

Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm run dev

# yarn
yarn dev

# bun
bun run dev
```

## Production

Build the application for production:

```bash
# npm
npm run build

# pnpm
pnpm run build

# yarn
yarn build

# bun
bun run build
```

Locally preview production build:

```bash
# npm
npm run preview

# pnpm
pnpm run preview

# yarn
yarn preview

# bun
bun run preview
```

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
5 changes: 5 additions & 0 deletions examples/yoastseo/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<NuxtWelcome />
</div>
</template>
31 changes: 31 additions & 0 deletions examples/yoastseo/extend/queries/fragments/Page.fragment.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#import '~/queries/fragments/ContentNode.fragment.gql';
#import '~/queries/fragments/CoreGallery.fragment.gql';
#import '~/queries/fragments/CoreImage.fragment.gql';
#import '~/queries/fragments/CoreParagraph.fragment.gql';
#import '~/queries/fragments/CoreQuote.fragment.gql';
#import '~/queries/fragments/EditorBlock.fragment.gql';

fragment Page on Page {
...ContentNode
content
isFrontPage
isPostsPage
isPreview
isPrivacyPage
isRestricted
isRevision
title
editorBlocks {
name
...CoreGallery
...CoreImage
...CoreParagraph
...CoreQuote
...EditorBlock
}
seo {
metaDesc
title
fullHead
}
}
28 changes: 28 additions & 0 deletions examples/yoastseo/extend/queries/fragments/Post.fragment.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

#import '~/queries/fragments/ContentNode.fragment.gql';
#import '~/queries/fragments/NodeWithFeaturedImage.fragment.gql';
#import '~/queries/fragments/CoreGallery.fragment.gql';
#import '~/queries/fragments/CoreImage.fragment.gql';
#import '~/queries/fragments/CoreParagraph.fragment.gql';
#import '~/queries/fragments/CoreQuote.fragment.gql';
#import '~/queries/fragments/EditorBlock.fragment.gql';

fragment Post on Post {
...ContentNode
...NodeWithFeaturedImage
content
title
editorBlocks {
name
...CoreGallery
...CoreImage
...CoreParagraph
...CoreQuote
...EditorBlock
}
seo {
metaDesc
title
fullHead
}
}
3 changes: 3 additions & 0 deletions examples/yoastseo/extend/wpinstall/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


# install Yoast SEO plugin & Add WPGraphQL SEO
4 changes: 4 additions & 0 deletions examples/yoastseo/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true }
})
17 changes: 17 additions & 0 deletions examples/yoastseo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"nuxt": "^3.10.3",
"vue": "^3.4.19",
"vue-router": "^4.3.0"
}
}
Binary file added examples/yoastseo/public/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/yoastseo/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
4 changes: 4 additions & 0 deletions examples/yoastseo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vernaillen/wpnuxt",
"version": "0.1.29",
"version": "0.1.30",
"description": "WPNuxt",
"repository": "vernaillen/wpnuxt-module",
"license": "MIT",
Expand Down
Loading

0 comments on commit ed0986b

Please sign in to comment.