AssertValidName throws on a name presumably generated by the library itself











up vote
0
down vote

favorite












This is using a quite intricate entity collection which mainly consist of JPA entities, but which also include proxies and entities fetched from APIs. I've only really annotated the base class I'm trying to fetch with @GraphQLQuery annotations, but it goes into the hierarchy below that, and at some point finds a property which is a static HashMap<String, String> with hardcoded contents. (I've learned not to ask...) At this point it throws this exception and everything stops:



graphql.AssertException: Name must be non-null, non-empty and match [_A-Za-z][_0-9A-Za-z]* - was 'Map_String_StringScalar'
at graphql.Assert.assertValidName(Assert.java:58)
at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:50)
at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:45)
at io.leangen.graphql.util.Scalars.graphQLMapScalar(Scalars.java:325)
at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:20)
at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:16)
at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
at io.leangen.graphql.generator.OperationMapper.lambda$generateQueries$0(OperationMapper.java:91)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.leangen.graphql.generator.OperationMapper.generateQueries(OperationMapper.java:92)
at io.leangen.graphql.generator.OperationMapper.<init>(OperationMapper.java:75)
at io.leangen.graphql.GraphQLSchemaGenerator.generate(GraphQLSchemaGenerator.java:868)
at com.ist.exam.graphql.services.GraphQLService.init(GraphQLService.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 39 more


I have no idea how this name is generated, but it comes out as "Map_String_StringScalar", which then throws on assertValidName.



I would annotate the property with @GraphQLQuery(name="somethingClever") , but at this point we're inside a library shared throughout the company, and changes made here have to go through a change request and stuff.



I tried to exclude this proxy package with withBasePackages, but that seemed to have no effect. This is the method trying to create the schema:



GraphQLSchema schema = new GraphQLSchemaGenerator()
.withBasePackages("entities")
.withResolverBuilders(new AnnotatedResolverBuilder())
.withOperationsFromSingleton(examService)
.withValueMapperFactory(new JacksonValueMapperFactory())
.generate();
graphQL = GraphQL.newGraphQL(schema).build();


Has anyone seen either of these problems before? Can I blacklist a package instead of whitelisting it? e.g. withBasePackages("!proxies")










share|improve this question


























    up vote
    0
    down vote

    favorite












    This is using a quite intricate entity collection which mainly consist of JPA entities, but which also include proxies and entities fetched from APIs. I've only really annotated the base class I'm trying to fetch with @GraphQLQuery annotations, but it goes into the hierarchy below that, and at some point finds a property which is a static HashMap<String, String> with hardcoded contents. (I've learned not to ask...) At this point it throws this exception and everything stops:



    graphql.AssertException: Name must be non-null, non-empty and match [_A-Za-z][_0-9A-Za-z]* - was 'Map_String_StringScalar'
    at graphql.Assert.assertValidName(Assert.java:58)
    at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:50)
    at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:45)
    at io.leangen.graphql.util.Scalars.graphQLMapScalar(Scalars.java:325)
    at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:20)
    at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:16)
    at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
    at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
    at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
    at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
    at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
    at io.leangen.graphql.generator.OperationMapper.lambda$generateQueries$0(OperationMapper.java:91)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at io.leangen.graphql.generator.OperationMapper.generateQueries(OperationMapper.java:92)
    at io.leangen.graphql.generator.OperationMapper.<init>(OperationMapper.java:75)
    at io.leangen.graphql.GraphQLSchemaGenerator.generate(GraphQLSchemaGenerator.java:868)
    at com.ist.exam.graphql.services.GraphQLService.init(GraphQLService.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
    ... 39 more


    I have no idea how this name is generated, but it comes out as "Map_String_StringScalar", which then throws on assertValidName.



    I would annotate the property with @GraphQLQuery(name="somethingClever") , but at this point we're inside a library shared throughout the company, and changes made here have to go through a change request and stuff.



    I tried to exclude this proxy package with withBasePackages, but that seemed to have no effect. This is the method trying to create the schema:



    GraphQLSchema schema = new GraphQLSchemaGenerator()
    .withBasePackages("entities")
    .withResolverBuilders(new AnnotatedResolverBuilder())
    .withOperationsFromSingleton(examService)
    .withValueMapperFactory(new JacksonValueMapperFactory())
    .generate();
    graphQL = GraphQL.newGraphQL(schema).build();


    Has anyone seen either of these problems before? Can I blacklist a package instead of whitelisting it? e.g. withBasePackages("!proxies")










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      This is using a quite intricate entity collection which mainly consist of JPA entities, but which also include proxies and entities fetched from APIs. I've only really annotated the base class I'm trying to fetch with @GraphQLQuery annotations, but it goes into the hierarchy below that, and at some point finds a property which is a static HashMap<String, String> with hardcoded contents. (I've learned not to ask...) At this point it throws this exception and everything stops:



      graphql.AssertException: Name must be non-null, non-empty and match [_A-Za-z][_0-9A-Za-z]* - was 'Map_String_StringScalar'
      at graphql.Assert.assertValidName(Assert.java:58)
      at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:50)
      at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:45)
      at io.leangen.graphql.util.Scalars.graphQLMapScalar(Scalars.java:325)
      at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:20)
      at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:16)
      at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
      at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
      at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
      at io.leangen.graphql.generator.OperationMapper.lambda$generateQueries$0(OperationMapper.java:91)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at io.leangen.graphql.generator.OperationMapper.generateQueries(OperationMapper.java:92)
      at io.leangen.graphql.generator.OperationMapper.<init>(OperationMapper.java:75)
      at io.leangen.graphql.GraphQLSchemaGenerator.generate(GraphQLSchemaGenerator.java:868)
      at com.ist.exam.graphql.services.GraphQLService.init(GraphQLService.java:27)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
      ... 39 more


      I have no idea how this name is generated, but it comes out as "Map_String_StringScalar", which then throws on assertValidName.



      I would annotate the property with @GraphQLQuery(name="somethingClever") , but at this point we're inside a library shared throughout the company, and changes made here have to go through a change request and stuff.



      I tried to exclude this proxy package with withBasePackages, but that seemed to have no effect. This is the method trying to create the schema:



      GraphQLSchema schema = new GraphQLSchemaGenerator()
      .withBasePackages("entities")
      .withResolverBuilders(new AnnotatedResolverBuilder())
      .withOperationsFromSingleton(examService)
      .withValueMapperFactory(new JacksonValueMapperFactory())
      .generate();
      graphQL = GraphQL.newGraphQL(schema).build();


      Has anyone seen either of these problems before? Can I blacklist a package instead of whitelisting it? e.g. withBasePackages("!proxies")










      share|improve this question













      This is using a quite intricate entity collection which mainly consist of JPA entities, but which also include proxies and entities fetched from APIs. I've only really annotated the base class I'm trying to fetch with @GraphQLQuery annotations, but it goes into the hierarchy below that, and at some point finds a property which is a static HashMap<String, String> with hardcoded contents. (I've learned not to ask...) At this point it throws this exception and everything stops:



      graphql.AssertException: Name must be non-null, non-empty and match [_A-Za-z][_0-9A-Za-z]* - was 'Map_String_StringScalar'
      at graphql.Assert.assertValidName(Assert.java:58)
      at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:50)
      at graphql.schema.GraphQLScalarType.<init>(GraphQLScalarType.java:45)
      at io.leangen.graphql.util.Scalars.graphQLMapScalar(Scalars.java:325)
      at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:20)
      at io.leangen.graphql.generator.mapping.common.ObjectScalarAdapter.toGraphQLType(ObjectScalarAdapter.java:16)
      at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
      at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.lambda$getFields$3(ObjectTypeMapper.java:88)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.getFields(ObjectTypeMapper.java:89)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:41)
      at io.leangen.graphql.generator.mapping.common.ObjectTypeMapper.toGraphQLType(ObjectTypeMapper.java:33)
      at io.leangen.graphql.generator.mapping.common.CachingMapper.toGraphQLType(CachingMapper.java:30)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:179)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLType(OperationMapper.java:165)
      at io.leangen.graphql.generator.OperationMapper.toGraphQLField(OperationMapper.java:138)
      at io.leangen.graphql.generator.OperationMapper.lambda$generateQueries$0(OperationMapper.java:91)
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      at io.leangen.graphql.generator.OperationMapper.generateQueries(OperationMapper.java:92)
      at io.leangen.graphql.generator.OperationMapper.<init>(OperationMapper.java:75)
      at io.leangen.graphql.GraphQLSchemaGenerator.generate(GraphQLSchemaGenerator.java:868)
      at com.ist.exam.graphql.services.GraphQLService.init(GraphQLService.java:27)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
      at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
      ... 39 more


      I have no idea how this name is generated, but it comes out as "Map_String_StringScalar", which then throws on assertValidName.



      I would annotate the property with @GraphQLQuery(name="somethingClever") , but at this point we're inside a library shared throughout the company, and changes made here have to go through a change request and stuff.



      I tried to exclude this proxy package with withBasePackages, but that seemed to have no effect. This is the method trying to create the schema:



      GraphQLSchema schema = new GraphQLSchemaGenerator()
      .withBasePackages("entities")
      .withResolverBuilders(new AnnotatedResolverBuilder())
      .withOperationsFromSingleton(examService)
      .withValueMapperFactory(new JacksonValueMapperFactory())
      .generate();
      graphQL = GraphQL.newGraphQL(schema).build();


      Has anyone seen either of these problems before? Can I blacklist a package instead of whitelisting it? e.g. withBasePackages("!proxies")







      java graphql-spqr






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 at 13:04









      tofagerl

      3810




      3810





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412685%2fassertvalidname-throws-on-a-name-presumably-generated-by-the-library-itself%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412685%2fassertvalidname-throws-on-a-name-presumably-generated-by-the-library-itself%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Berounka

          Sphinx de Gizeh

          Different font size/position of beamer's navigation symbols template's content depending on regular/plain...