GithubHelp home page GithubHelp logo

illyasviel / elide-spring-boot Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 10.0 187 KB

Elide Spring-Boot-Starter will help you use Elide with Spring Boot

License: Apache License 2.0

Java 100.00%
java spring-boot jpa json-api

elide-spring-boot's Introduction

Elide integration with Spring Boot

Build Status Coverage Status License Maven Central

๐ŸŽ‰ Now, Elide has official support for Spring, please check out Elide Spring Artifacts. ๐ŸŽ‰

Elide Spring-Boot-Starter will help you use Elide with Spring Boot

  • Automatically configure elide and json:api/GraphQL controller.
  • Integrated Spring Transaction.
  • Integrated Spring Dependency Injection (optional).
  • A convenience annotation, @ElideCheck("expression"), help you register elide check.
  • A convenience annotation, @ElideHook(lifeCycle = OnXXX.class), help you register elide function hook.
  • Catch org.hibernate.exception.ConstraintViolationException return HTTP 422.

Usage

<dependency>
  <groupId>org.illyasviel.elide</groupId>
  <artifactId>elide-spring-boot-starter</artifactId>
  <version>1.4.0</version>
</dependency>

The GraphQL auto configuration takes effect when elide-graphql on the classpath.

<dependency>
  <groupId>com.yahoo.elide</groupId>
  <artifactId>elide-graphql</artifactId>
  <version>${elide.version}</version>
</dependency>

Example

Check out the elide-spring-boot-sample.

Configuration

The following shows all the default properties.

elide:
  prefix: "/api"
  default-page-size: 20
  max-page-size: 100
  spring-dependency-injection: true
  return-error-objects: false
  mvc:
    enable: true
    get: true
    post: true
    patch: true
    delete: true
    graphql: true

elide-spring-boot's People

Contributors

olowolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elide-spring-boot's Issues

Question: GraphQL support

Hey there, first of all I just want to say thank you for this project, it made getting Elide setup with Spring Boot a breeze!

I'll be honest, I'm a rookie to Java, Spring Boot, & Elide, so I'm figuring a lot of this out as I go. So far I've been successful at getting the JSON API working using this lib, but haven't been able to figure out how to go about enabling GraphQL. The Elide docs aren't very clear, other than to say it needs to be mounted to an endpoint like /graphql. It seems like that would be a good fit for the auto configuration this project is providing? Just curious if that's something being considered?

Thanks!

JSON-API patch extension

Hey @olOwOlo, I am looking to utilize Elide's support for bulk writes via their support for the JSON-API patch extension, but it doesn't appear this project will accept/route content using application/vnd.api+json; ext=jsonpatch headers. Any suggestions?

Sample application - pagination does not seem to work correctly

Hi @olOwOlo,
Thanks for great job.

I started playing around with the sample application and looks like the pagination does not seem to work correctly. Hope that you could look into this.

Steps to reproduce:

  1. Run the sample application
  2. use Postman to send (25) POST request http://localhost:8080/api/user
  3. use Postman to send GET request http://localhost:8080/api/user?page[number]=1&page[size]=3&page[totals]

Then the sample application returns HTTP Status 400 โ€“ Bad Request

Also, could you please advise the following case given that created already 25 users:
I try making GET request http://localhost:8080/api/user without pagination params, then the sample application returns data of 20 users only which is correct as per the default configuration. The question now is how to get the rest of 5 users created?

Appreciate your time.
Thai

Please provide the command to run the sample

I tried to run it using mvn spring-boot:run but that didn't work:

[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\ita223.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

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.