Skip to content
⎔ A Laravel Mix extension of GraphQL support for Webpack.
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
_config.yml
index.js
package.json
yarn.lock

README.md

Laravel Mix GraphQL Extension

Downloads Release License

A Laravel Mix extension for GraphQL support for Webpack.

Installation

yarn add -D @pp-spaces/laravel-mix-graphql

or

npm install @pp-spaces/laravel-mix-graphql --save-dev

Laravel Mix Configuration

In your webpack.mix.js, import @pp-spaces/laravel-mix-graphql:

// webpack.mix.js

const mix = require("laravel-mix");

/**
 * Import laravel-mix-graphql
 */
require("@pp-spaces/laravel-mix-graphql");

/**
 * Register loader
 */
mix
  .js("resources/js/app.js", "public/js")
  .sass("resources/sass/app.scss", "public/css")
  .graphql();

Done!, re-run your compile command.

Usage

Within your project, e.g. app.js, you can import .graphql or .gql schema directly.

// app.js

import UserQuery from "./graphql/UserQuery.graphql";

Author

Socheat, Web Developer

Twitter Follow

You can’t perform that action at this time.