Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit d7fb47c

Browse files
shaileshmishrashaileshmishra
authored andcommitted
📝 README.md updated
1 parent 7a09116 commit d7fb47c

File tree

9 files changed

+59
-9
lines changed

9 files changed

+59
-9
lines changed

README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
1-
# graphql-spring-boot-client
1+
## GraphQl-Spring-Boot-Client Example Web App
22

3-
## graphql-spring-boot-client example for the quick starter for graphql api integration in spring boot
3+
### Quick starter for graphql api integration in spring boot
4+
5+
6+
Spring Boot is an open-source framework that allows Java developers to create production-grade Spring applications.
7+
8+
This step-by-step guide details how to create a Java sample app via Spring Boot. This app, powered by Contentstack’s Java SDK, uses GraphQL API to fetch content stored in Contentstack and display it on your application.
9+
10+
## Prerequisites
11+
12+
- A text editor or an IDE, for example, [IntelliJ IDEA](https://www.jetbrains.com/idea/download/)
13+
14+
- [JDK 1.8 or later](https://www.oracle.com/in/java/technologies/javase/javase-jdk8-downloads.html)
15+
16+
- Gradle 4+ or Maven 3.2+
17+
18+
- [Spring Tool Suite (STS)](https://spring.io/tools)
19+
20+
- [Contentstack account](https://www.contentstack.com/login/)
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
### Screenshots
33+
34+
![image info](./assets/one.png)
35+
36+
- Home
37+
38+
![image info](./assets/two.png)
39+
40+
- AboutUs
41+
42+
![image info](./assets/three.png)
43+
44+
- Our Team
45+
46+
![image info](./assets/four.png)
47+
48+
- Blog
49+
50+
![image info](./assets/five.png)
51+
52+
- Blogs
53+
54+
![image info](./assets/six.png)
55+
56+
- ContactUs
57+
58+
![image info](./assets/seven.png)

assets/five.png

430 KB
Loading

assets/four.png

2.78 MB
Loading

assets/one.png

453 KB
Loading

assets/seven.png

1.01 MB
Loading

assets/six.png

587 KB
Loading

assets/three.png

462 KB
Loading

assets/two.png

407 KB
Loading

src/main/java/com/contentstack/gqlspring/GraphqlApp.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.springframework.web.bind.annotation.PathVariable;
1212
import org.springframework.web.bind.annotation.RequestParam;
1313

14-
import java.util.Date;
1514
import java.util.Objects;
1615

1716
@SpringBootApplication
@@ -93,11 +92,11 @@ public String blogs(Model model) {
9392

9493
String archivedBlogsQuery = Objects.requireNonNull(Util.load("archived.graphql"));
9594
Object archivedBlogsResp = contentstack.getQuery(archivedBlogsQuery,
96-
"all_blog_post", ArchivedModel[].class); // TODO: inList it
95+
"all_blog_post", ArchivedModel[].class);
9796

9897
String allBlogListQuery = Objects.requireNonNull(Util.load("no_archived.graphql"));
9998
Object allBlogListResp = contentstack.getQuery(allBlogListQuery,
100-
"all_blog_post", BlogListModel[].class); // TODO: inList it
99+
"all_blog_post", BlogListModel[].class);
101100

102101
String queryString = Objects.requireNonNull(Util.load("footer.graphql"));
103102
Object footerResp = contentstack.getQuery(queryString,
@@ -108,8 +107,6 @@ public String blogs(Model model) {
108107
model.addAttribute("home", "Could not fetch Blog page..");
109108
} else {
110109
model.addAttribute("banner", "blog");
111-
model.addAttribute("standardDate", new Date());
112-
113110
model.addAttribute("header", headerResp);
114111
model.addAttribute("data", blogResp);
115112
model.addAttribute("archived", archivedBlogsResp);
@@ -168,8 +165,6 @@ public String blogPost(@PathVariable String id, Model model) {
168165
model.addAttribute("blog post", "Could not fetch Blog post page..");
169166
} else {
170167
model.addAttribute("banner", "blog");
171-
model.addAttribute("standardDate", new Date());
172-
173168
model.addAttribute("header", headerResp);
174169
model.addAttribute("blogPost", blogPostResp);
175170
model.addAttribute("data", blogResp);

0 commit comments

Comments
 (0)