Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: set name
run: |
git config --global user.name "release-bot";
git config --global user.email "release-bot@fleetpin.co.nz";
git config --global user.email "release-bot@phocas.co.nz";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is wrong - i'll fix it in the release PR


- name: add key
run: |
Expand Down
11 changes: 1 addition & 10 deletions graphql-builder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<url>https://github.com/ashley-taylor/graphql-builder</url>

<parent>
<groupId>com.fleetpin</groupId>
<groupId>com.phocas</groupId>
<artifactId>graphql-database-manager</artifactId>
<version>3.0.4-SNAPSHOT</version>
</parent>
Expand Down Expand Up @@ -62,15 +62,6 @@
</license>
</licenses>

<developers>
<developer>
<name>Ashley Taylor</name>
<email>[email protected]</email>
<organization>Fleetpin</organization>
<organizationUrl>http://www.fleetpin.co.nz</organizationUrl>
</developer>
</developers>

<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

public interface Authorizer {}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import static com.fleetpin.graphql.builder.EntityUtil.isContext;
import static com.phocassoftware.graphql.builder.EntityUtil.isContext;

import graphql.GraphQLContext;
import graphql.GraphqlErrorException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import graphql.schema.DataFetcher;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import java.lang.annotation.Annotation;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.Directive;
import com.phocassoftware.graphql.builder.annotations.Directive;
import graphql.introspection.Introspection;
import graphql.schema.*;
import java.lang.annotation.Annotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.DataFetcherWrapper;
import com.fleetpin.graphql.builder.annotations.Directive;
import com.phocassoftware.graphql.builder.annotations.DataFetcherWrapper;
import com.phocassoftware.graphql.builder.annotations.Directive;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import graphql.schema.GraphQLAppliedDirective;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.TypeMeta.Flag;
import com.fleetpin.graphql.builder.annotations.Id;
import com.fleetpin.graphql.builder.mapper.InputTypeBuilder;
import com.phocassoftware.graphql.builder.TypeMeta.Flag;
import com.phocassoftware.graphql.builder.annotations.Id;
import com.phocassoftware.graphql.builder.mapper.InputTypeBuilder;
import graphql.Scalars;
import graphql.schema.GraphQLInputType;
import graphql.schema.GraphQLList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.Scalar;
import com.fleetpin.graphql.builder.annotations.Union;
import com.fleetpin.graphql.builder.mapper.InputTypeBuilder;
import com.phocassoftware.graphql.builder.annotations.Scalar;
import com.phocassoftware.graphql.builder.annotations.Union;
import com.phocassoftware.graphql.builder.mapper.InputTypeBuilder;
import graphql.Scalars;
import graphql.schema.GraphQLAppliedDirective;
import graphql.schema.GraphQLCodeRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.Context;
import com.fleetpin.graphql.builder.annotations.GraphQLIgnore;
import com.fleetpin.graphql.builder.annotations.GraphQLName;
import com.fleetpin.graphql.builder.annotations.InputIgnore;
import com.phocassoftware.graphql.builder.annotations.Context;
import com.phocassoftware.graphql.builder.annotations.GraphQLIgnore;
import com.phocassoftware.graphql.builder.annotations.GraphQLName;
import com.phocassoftware.graphql.builder.annotations.InputIgnore;
import graphql.GraphQLContext;
import graphql.schema.DataFetchingEnvironment;
import java.lang.annotation.Annotation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import static graphql.schema.GraphQLEnumValueDefinition.newEnumValueDefinition;

import com.fleetpin.graphql.builder.annotations.GraphQLDescription;
import com.fleetpin.graphql.builder.annotations.GraphQLIgnore;
import com.fleetpin.graphql.builder.mapper.InputTypeBuilder;
import com.phocassoftware.graphql.builder.annotations.GraphQLDescription;
import com.phocassoftware.graphql.builder.annotations.GraphQLIgnore;
import com.phocassoftware.graphql.builder.mapper.InputTypeBuilder;
import graphql.schema.GraphQLEnumType;
import graphql.schema.GraphQLNamedInputType;
import graphql.schema.GraphQLNamedOutputType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import graphql.ErrorClassification;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;

import com.fleetpin.graphql.builder.annotations.Entity;
import com.fleetpin.graphql.builder.annotations.GraphQLDescription;
import com.fleetpin.graphql.builder.annotations.GraphQLIgnore;
import com.fleetpin.graphql.builder.annotations.InputIgnore;
import com.fleetpin.graphql.builder.annotations.OneOf;
import com.fleetpin.graphql.builder.annotations.SchemaOption;
import com.fleetpin.graphql.builder.mapper.ConstructorFieldBuilder;
import com.fleetpin.graphql.builder.mapper.ConstructorFieldBuilder.RecordMapper;
import com.fleetpin.graphql.builder.mapper.InputTypeBuilder;
import com.fleetpin.graphql.builder.mapper.ObjectFieldBuilder;
import com.fleetpin.graphql.builder.mapper.ObjectFieldBuilder.FieldMapper;
import com.fleetpin.graphql.builder.mapper.OneOfBuilder;
package com.phocassoftware.graphql.builder;

import com.phocassoftware.graphql.builder.annotations.Entity;
import com.phocassoftware.graphql.builder.annotations.GraphQLDescription;
import com.phocassoftware.graphql.builder.annotations.GraphQLIgnore;
import com.phocassoftware.graphql.builder.annotations.InputIgnore;
import com.phocassoftware.graphql.builder.annotations.OneOf;
import com.phocassoftware.graphql.builder.annotations.SchemaOption;
import com.phocassoftware.graphql.builder.mapper.ConstructorFieldBuilder;
import com.phocassoftware.graphql.builder.mapper.ConstructorFieldBuilder.RecordMapper;
import com.phocassoftware.graphql.builder.mapper.InputTypeBuilder;
import com.phocassoftware.graphql.builder.mapper.ObjectFieldBuilder;
import com.phocassoftware.graphql.builder.mapper.ObjectFieldBuilder.FieldMapper;
import com.phocassoftware.graphql.builder.mapper.OneOfBuilder;
import graphql.schema.GraphQLInputObjectField;
import graphql.schema.GraphQLInputObjectType;
import graphql.schema.GraphQLInputObjectType.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import static com.fleetpin.graphql.builder.EntityUtil.isContext;
import static com.phocassoftware.graphql.builder.EntityUtil.isContext;

import com.fleetpin.graphql.builder.annotations.Directive;
import com.fleetpin.graphql.builder.annotations.GraphQLDeprecated;
import com.fleetpin.graphql.builder.annotations.GraphQLDescription;
import com.fleetpin.graphql.builder.annotations.Mutation;
import com.fleetpin.graphql.builder.annotations.Query;
import com.fleetpin.graphql.builder.annotations.Subscription;
import com.phocassoftware.graphql.builder.annotations.Directive;
import com.phocassoftware.graphql.builder.annotations.GraphQLDeprecated;
import com.phocassoftware.graphql.builder.annotations.GraphQLDescription;
import com.phocassoftware.graphql.builder.annotations.Mutation;
import com.phocassoftware.graphql.builder.annotations.Query;
import com.phocassoftware.graphql.builder.annotations.Subscription;
import graphql.GraphQLContext;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
Expand Down Expand Up @@ -91,6 +91,7 @@ Builder process(AuthorizerSchema authorizer, FieldCoordinates coordinates, TypeM

field.name(coordinates.getFieldName());


TypeMeta meta = new TypeMeta(parentMeta, method.getReturnType(), method.getGenericReturnType(), method);
var type = entityProcessor.getType(meta, method.getAnnotations());
field.type(type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.GraphQLCreator;
import com.fleetpin.graphql.builder.annotations.OneOf;
import com.fleetpin.graphql.builder.mapper.InputTypeBuilder;
import com.phocassoftware.graphql.builder.annotations.GraphQLCreator;
import com.phocassoftware.graphql.builder.annotations.OneOf;
import com.phocassoftware.graphql.builder.mapper.InputTypeBuilder;
import graphql.schema.GraphQLNamedInputType;
import graphql.schema.GraphQLNamedOutputType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import graphql.schema.DataFetchingEnvironment;
import java.lang.reflect.ParameterizedType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.GraphQLDescription;
import com.fleetpin.graphql.builder.annotations.Scalar;
import com.fleetpin.graphql.builder.mapper.InputTypeBuilder;
import com.phocassoftware.graphql.builder.annotations.GraphQLDescription;
import com.phocassoftware.graphql.builder.annotations.Scalar;
import com.phocassoftware.graphql.builder.mapper.InputTypeBuilder;
import graphql.schema.Coercing;
import graphql.schema.GraphQLNamedInputType;
import graphql.schema.GraphQLNamedOutputType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.*;
import com.phocassoftware.graphql.builder.annotations.*;
import graphql.schema.GraphQLScalarType;
import graphql.schema.GraphQLSchema;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

/**
* Used to add extra information to the schema. Currently only supports directives. That are inferred using the annotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;
package com.phocassoftware.graphql.builder;

import com.fleetpin.graphql.builder.annotations.Entity;
import com.fleetpin.graphql.builder.annotations.GraphQLDescription;
import com.fleetpin.graphql.builder.annotations.GraphQLIgnore;
import com.phocassoftware.graphql.builder.annotations.Entity;
import com.phocassoftware.graphql.builder.annotations.GraphQLDescription;
import com.phocassoftware.graphql.builder.annotations.GraphQLIgnore;
import graphql.schema.FieldCoordinates;
import graphql.schema.GraphQLInterfaceType;
import graphql.schema.GraphQLNamedOutputType;
Expand All @@ -22,6 +22,7 @@
import graphql.schema.GraphQLTypeReference;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Objects;

public abstract class TypeBuilder {

Expand Down Expand Up @@ -167,6 +168,7 @@ public ObjectType(EntityProcessor entityProcessor, TypeMeta meta) {
protected void processFields(String typeName, Builder graphType, graphql.schema.GraphQLInterfaceType.Builder interfaceBuilder)
throws ReflectiveOperationException {
var type = meta.getType();

for (Method method : type.getMethods()) {
try {
var name = EntityUtil.getter(method);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fleetpin.graphql.builder;

import com.fleetpin.graphql.builder.annotations.InnerNullable;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
package com.phocassoftware.graphql.builder;

import com.phocassoftware.graphql.builder.annotations.InnerNullable;

import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -70,6 +67,13 @@ private void processGeneric(TypeMeta target, TypeVariable type, AnnotatedElement
if (owningClass instanceof Class) {
findType(target, type, (Class) owningClass, element);
} else if (owningClass instanceof ParameterizedType) {
if (element instanceof Member member) {
var declaringClass = member.getDeclaringClass();
if (declaringClass.equals(target.type)) {
findType(target, type, target.type, element);
return;
}
}
var pt = (ParameterizedType) owningClass;
if (!matchType(target, type.getTypeName(), pt, true, element)) {
throw new UnsupportedOperationException("Does not handle type " + owningClass);
Expand Down
Loading
Loading