Skip to content

Commit 7b58f88

Browse files
authored
Merge pull request #290 from graphql-java-kickstart/bugfix/response-from-cache
Bugfix/response from cache
2 parents a29cf45 + 5a226d0 commit 7b58f88

File tree

14 files changed

+213
-63
lines changed

14 files changed

+213
-63
lines changed

.github/workflows/pull-request.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: "Pull request"
22
on:
3-
push:
4-
branches-ignore:
5-
- master
63
pull_request:
74
types: [opened, synchronize, reopened]
85
jobs:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ build/
33
*.iml
44
*.ipr
55
*.iws
6-
.idea/
6+
**/.idea/
77
target/
88
/out/
99
.classpath
1010
.project
1111
.settings
1212
bin
1313
.DS_Store
14+
/**/out/

examples/osgi/apache-karaf-feature/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</configuration>
1515
<extensions>true</extensions>
1616
<groupId>org.apache.karaf.tooling</groupId>
17-
<version>4.0.8</version>
17+
<version>4.2.10</version>
1818
</plugin>
1919

2020
<plugin>
@@ -108,7 +108,7 @@
108108
<parent>
109109
<artifactId>graphql-java-servlet-osgi-examples</artifactId>
110110
<groupId>com.graphql-java-kickstart</groupId>
111-
<version>7.3.4-SNAPSHOT</version>
111+
<version>10.1.0</version>
112112
</parent>
113113

114114
<properties>

examples/osgi/apache-karaf-feature/src/main/feature/feature.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
name="graphql-java-servlet-osgi-examples-karaf-feature">
66
<feature dependency="false" prerequisite="true">scr</feature>
77
<feature dependency="false" prerequisite="true">war</feature>
8+
<feature dependency="false" prerequisite="true">http</feature>
89
</feature>
910
</features>

examples/osgi/apache-karaf-package/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@
110110
<parent>
111111
<artifactId>graphql-java-servlet-osgi-examples</artifactId>
112112
<groupId>com.graphql-java-kickstart</groupId>
113-
<version>7.3.4-SNAPSHOT</version>
113+
<version>10.1.0</version>
114114
</parent>
115115
</project>

examples/osgi/buildAndRun.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
mvn clean install
3-
pushd apache-karaf-package/target
4-
tar zxvf graphql-java-servlet-osgi-examples-apache-karaf-package-7.3.4-SNAPSHOT.tar.gz
5-
cd graphql-java-servlet-osgi-examples-apache-karaf-package-7.3.4-SNAPSHOT/bin
3+
pushd apache-karaf-package/target || exit 1
4+
tar zxvf graphql-java-servlet-osgi-examples-apache-karaf-package-10.1.0.tar.gz
5+
cd graphql-java-servlet-osgi-examples-apache-karaf-package-10.1.0/bin || exit 1
66
./karaf debug
7-
popd
7+
popd || exit 1

examples/osgi/pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
<packaging>pom</packaging>
1515

1616
<properties>
17-
<graphql.java.servlet.version>7.3.4-SNAPSHOT</graphql.java.servlet.version>
18-
<graphql.java.version>11.0</graphql.java.version>
19-
<karaf.version>4.2.4</karaf.version>
17+
<graphql.java.servlet.version>11.0.0-SNAPSHOT</graphql.java.servlet.version>
18+
<graphql.java.version>16.1</graphql.java.version>
19+
<karaf.version>4.2.10</karaf.version>
20+
<maven.compiler.source>1.8</maven.compiler.source>
21+
<maven.compiler.target>1.8</maven.compiler.target>
2022
</properties>
2123

22-
<version>7.3.4-SNAPSHOT</version>
24+
<version>10.1.0</version>
2325

2426
</project>

examples/osgi/providers/pom.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<plugin>
99
<artifactId>maven-bundle-plugin</artifactId>
1010
<configuration>
11-
<instructions>
12-
</instructions>
1311
</configuration>
1412
<extensions>true</extensions>
1513
<groupId>org.apache.felix</groupId>
@@ -51,7 +49,7 @@
5149
<parent>
5250
<artifactId>graphql-java-servlet-osgi-examples</artifactId>
5351
<groupId>com.graphql-java-kickstart</groupId>
54-
<version>7.3.4-SNAPSHOT</version>
52+
<version>10.1.0</version>
5553
</parent>
5654

5755
</project>

examples/osgi/providers/src/main/java/graphql/servlet/examples/osgi/ExampleGraphQLProvider.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package graphql.kickstart.servlet.examples.osgi;
1+
package graphql.servlet.examples.osgi;
22

33
import graphql.schema.GraphQLFieldDefinition;
44
import graphql.schema.GraphQLType;
5-
import graphql.servlet.GraphQLMutationProvider;
6-
import graphql.servlet.GraphQLQueryProvider;
7-
import graphql.servlet.GraphQLTypesProvider;
5+
import graphql.kickstart.servlet.osgi.GraphQLMutationProvider;
6+
import graphql.kickstart.servlet.osgi.GraphQLQueryProvider;
7+
import graphql.kickstart.servlet.osgi.GraphQLTypesProvider;
88
import org.osgi.service.component.annotations.Component;
99

1010
import java.util.ArrayList;
@@ -38,8 +38,6 @@ public Collection<GraphQLFieldDefinition> getMutations() {
3838
}
3939

4040
public Collection<GraphQLType> getTypes() {
41-
42-
List<GraphQLType> types = new ArrayList<GraphQLType>();
43-
return types;
41+
return new ArrayList<GraphQLType>();
4442
}
4543
}

graphql-java-servlet/src/main/java/graphql/kickstart/servlet/OsgiGraphQLHttpServlet.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,7 @@ protected void updateSchema() {
131131
updateFuture.cancel(true);
132132
}
133133

134-
updateFuture = executor.schedule(new Runnable() {
135-
@Override
136-
public void run() {
137-
doUpdateSchema();
138-
}
139-
}, schemaUpdateDelay, TimeUnit.MILLISECONDS);
134+
updateFuture = executor.schedule(this::doUpdateSchema, schemaUpdateDelay, TimeUnit.MILLISECONDS);
140135
}
141136
}
142137

@@ -147,17 +142,17 @@ private void doUpdateSchema() {
147142
if (!queryProviders.isEmpty()) {
148143
for (GraphQLQueryProvider provider : queryProviders) {
149144
if (provider.getQueries() != null && !provider.getQueries().isEmpty()) {
150-
provider.getQueries().forEach(queryTypeBuilder::field);
145+
provider.getQueries().forEach(queryTypeBuilder::field);
151146
}
152147
}
153148
} else {
154149
// graphql-java enforces Query type to be there with at least some field.
155150
queryTypeBuilder.field(
156-
GraphQLFieldDefinition
157-
.newFieldDefinition()
158-
.name("_empty")
159-
.type(Scalars.GraphQLBoolean)
160-
.build());
151+
GraphQLFieldDefinition
152+
.newFieldDefinition()
153+
.name("_empty")
154+
.type(Scalars.GraphQLBoolean)
155+
.build());
161156
}
162157

163158
final Set<GraphQLType> types = new HashSet<>();

0 commit comments

Comments
 (0)