anwoon/blueprint-graphql-addon

There is no license information available for the latest version (1.0.4) of this package.

The addon of blueprint for generate graphql type file for lighthouse or other library

Installs: 22

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/anwoon/blueprint-graphql-addon

1.0.4 2022-08-31 12:52 UTC

This package is auto-updated.

Last update: 2025-09-29 02:59:28 UTC


README

Installation

composer require --dev anwoon/blueprint-graphql-addon

you need to add this in your filesystem disk

'graphql' => [
    'driver' => 'local',
    'root' => 'graphql',
    'throw' => false,
],

Usage

Refer to Blueprint's Basic Usage to get started. Afterwards you can run the blueprint:build command to generate Graphql resources automatically. To get an idea of how easy it is you can use the example draft.yaml file below.

models:
  Post:
    title: string:400
    content: longtext
    total: decimal:8,2
    status: enum:pending,successful,failed
    published_at: timestamp nullable
    author_id: id foreign:users
    relationships:
      hasMany: Comment
      belongsToMany: Site
      belongsTo: User
type Post implements Model {
    id: ID!
    title: String!
    content: String!
    total: String!
    status: Status!
    published_at: Timestamp
    author_id: ID!
    comments: [Comment!] @hasMany
    sites: [Site!] @belongsToMany
    user: User! @belongsTo
}

enum Status {
    PENDING
    SUCCESSFUL
    FAILED
}