Giter Club home page Giter Club logo

pepper's Introduction

Test

Install via composer:

composer require pepperlabs/pepper

Pepper is an automatic GraphQL exposing Laravel package. It uses your application defined models to auto define properties and relations. It supports Query and Mutation out of the box.

features:

  • Customizable validation, authentication, and authorization
  • Optional JWT support for protecting routes including login, register, forget password and reset password
  • Support all Laravel Eloquent databases (SQLite, MySQL, PostgreSQL, SQLServer)

Please note that this repo is still a work-in-progress project.

Version support

PHP: 8.1

Laravel: 9.x

Supported databases

As it uses Laravel Eloquent only, it can support all supported Laravel ORM such as: SQLite, MySQL, PostgreSQL and, SQLServer.

If you discover a security vulnerability within Pepper, please send an e-mail to Amirmasoud Sheydaei via [email protected]. All security vulnerabilities will be promptly addressed.

Contributing

Testing

Run PHPStan:

analyse

composer analyse

test

composer test

test-coverage

composer test-coverage

format

composer format

License

The MIT License (MIT). Please see License File File for more information.

pepper's People

Contributors

amirmasoud avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pepper's Issues

Change Cover and Exposed to include and exclude

For better syntax it is better to change

Covered -> Exclude

Exposed -> Include

Also might be useful to follow this: (from GitHub Actions docs)

Note: All include combinations are processed after exclude. This allows you to use include to add back combinations that were previously excluded.

Handle different primary key in a model

in mutations (mostly), the assumption is that, there is column called ID, and it is primary key. it would be better if it was fetched via model primary key method.

Fix config pepper.namepsace.root

Change:
config('pepper.namespace.root').'\Http\Pepper'

to:
config('pepper.namespace.root')

Change:
'pepper.namespace.root' =>App
To:
'pepper.namespace.root' =>App\Http\Pepper

Set default values for covered fields

  • set default values for covered values such as password or other possible sensitive columns.
  • Make it globally customizable
  • Make it customizable by model

[Feature] Add custom where condition

Add ability to add custom where condition on the QuerySupport file on the runCondition method by overriding or augmenting currently defined conditions.

a suggested syntax could be like:

public function addOperation('_custom_operation', $query, $operation, $field, $value, $exp = 'and')
{
    // return $query->where($field, '=', $value, $exp);
}

Second aggregation not working

the following query not working:

{
  post_aggregate {
    aggregate {
      count
      sum {
        ...aggregateOnFragment
      }
      avg {
        ...aggregateOnFragment
      }
      max {
        ...aggregateOnFragment
      }
      min {
        ...aggregateOnFragment
      }
    }
  }
  user_aggregate {
    aggregate {
      count
      sum {
        ...aggregateOnFragment
      }
      avg {
        ...aggregateOnFragment
      }
      max {
        ...aggregateOnFragment
      }
      min {
        ...aggregateOnFragment
      }
    }
  }
}

fragment aggregateOnFragment on PostResultAggregateType {
  id
}

A possible point of failure: aggregateSupport trait.

Field Privacy

Field privacy is not working with field selection. should be manual.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.