Skip to content

belyaev-andrey/spring-data-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Data GraphQL

The idea is to use spring-data repositories to query GraphQL endpoints.

For the entity:

public class Project {

    private Long id;

    private String name;
    
    //Getters and setters omitted
}

And repository:

public interface ProjectRepository extends GraphQlDataRepository<Project, Long> {

    List<Project> findAllProjects();

    List<Project> findProjectByName(String name);

    List<Project> findByNameAndId(String name, Long id);
}

The following GraphQL queries will be generated by this repository:

{"query":"query { findAllProjects {id name}}"}

{"query":"query { findProjectByName(name:\"NAME\") {id name}}"}

{"query":"query { findByNameAndId(name:\"NAME\", id:\"ID\") {id name}}"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages