Skip to content

Commit 12efd79

Browse files
authored
Upgrade to GraphQl 26 (#837)
1 parent 8aff376 commit 12efd79

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

src/main/java/org/craftercms/engine/graphql/impl/GraphQLFactoryImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
2+
* Copyright (C) 2007-2026 Crafter Software Corporation. All Rights Reserved.
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License version 3 as published by
@@ -211,7 +211,7 @@ protected GraphQLSchema buildSchema(SiteContext siteContext) {
211211
runInitScript(siteContext, rootType, codeRegistry, customizer, siteTypes);
212212

213213
// Build the content-type related types, needs to be done after the init script to support custom fields
214-
Set<GraphQLType> additionalTypes = new HashSet<>();
214+
Set<GraphQLNamedType> additionalTypes = new HashSet<>();
215215
siteTypes.forEach((name, type) -> additionalTypes.add(type.build()));
216216

217217
return GraphQLSchema.newSchema()

src/main/java/org/craftercms/engine/graphql/impl/SchemaCustomizer.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
2+
* Copyright (C) 2007-2026 Crafter Software Corporation. All Rights Reserved.
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License version 3 as published by
@@ -24,13 +24,7 @@
2424
import java.util.Map;
2525
import java.util.Set;
2626

27-
import graphql.schema.DataFetcher;
28-
import graphql.schema.GraphQLCodeRegistry;
29-
import graphql.schema.GraphQLFieldDefinition;
30-
import graphql.schema.GraphQLObjectType;
31-
import graphql.schema.GraphQLType;
32-
import graphql.schema.StaticDataFetcher;
33-
import graphql.schema.TypeResolver;
27+
import graphql.schema.*;
3428
import org.apache.commons.lang3.StringUtils;
3529
import org.craftercms.engine.graphql.impl.fetchers.ConverterDataFetcher;
3630
import org.slf4j.Logger;
@@ -68,7 +62,7 @@ public class SchemaCustomizer {
6862
/**
6963
* List of additional types to add
7064
*/
71-
protected List<GraphQLType> additionalTypes = new LinkedList<>();
65+
protected List<GraphQLNamedType> additionalTypes = new LinkedList<>();
7266

7367
/**
7468
* Adds a custom field to the root type
@@ -136,7 +130,7 @@ public void resolver(String typeName, TypeResolver resolver) {
136130
*
137131
* @param types the types to add
138132
*/
139-
public void additionalTypes(GraphQLType... types) {
133+
public void additionalTypes(GraphQLNamedType... types) {
140134
additionalTypes.addAll(Arrays.asList(types));
141135
}
142136

@@ -191,7 +185,7 @@ protected void apply(String rootTypeName, GraphQLObjectType.Builder rootTypeBuil
191185
/**
192186
* Returns the set of additional types to add
193187
*/
194-
public Set<GraphQLType> getAdditionalTypes() {
188+
public Set<GraphQLNamedType> getAdditionalTypes() {
195189
return new HashSet<>(additionalTypes);
196190
}
197191

0 commit comments

Comments
 (0)