Giter Club home page Giter Club logo

dgs-examples-java's People

Contributors

berngp avatar bodiam avatar dependabot[bot] avatar ehsaniara avatar gracecding avatar kilink avatar paulbakker avatar springmonster avatar srinivasankavitha avatar sullis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dgs-examples-java's Issues

dataloader not work

To avoid the N+1 problem, I defined a DataLoader, for example ReviewsDataLoader. After I do a mutation, I call the query method again. The "load" method in the ReviewsDataLoader is called multiple times. ReviewsDataLoader not work. I don't know how to solve this problem.

small question

what is the best way to dump the I got as a response from the execution?

dgsQueryExecutor.execute but no matter what it returns a linked hash map, which therefore
lose the order when I try to convert it back to JSON with?

I have the impression there must be an obvious vai to dump the response... and I am looking for it :)

How to use extends keyword of Java in Graphql

I am having a class Foo & Boo

public class Foo{
String a;
}
public class Boo extends Foo{
String b;
}

Boo will be my output object in .graphqls

I am able to get the response of Boo in this. But if I wanted to get the a also as the output of above query then how can we define the type and graphqls.

Is there any support present in dgs framework.

spring boot 3.x '/graphql' endpoint not appear

Hi there.

I found issue when try to excute this project.

Using commit that 'spring boot 3.x' applied then not appear '/graphql' endpoint.

spring boot 3.0 ( commit ID : 20fb399 ) running console
image

spring boot 2.7 ( commit ID : c8e0bcb ) running console
image

How to solve this issue?

Thanks in advence.

showWithReviews test case breaks if submittedDate is added

If you change this line to

.reviews().submittedDate()

The ObjectMapper cannot deserialize the date.

Error deserializing data from '{"data":{"shows":[{"title":"mock title","reviews":[{"submittedDate":"2021-04-15T11:37:22.424887-04:00","username":"DGS User","starScore":5},{"submittedDate":"2021-04-15T11:37:22.424953-04:00","username":"DGS User 2","starScore":3}]}]}}' with JsonPath 'data.shows[*]' and target class java.util.List<com.example.demo.generated.types.Show>
DgsQueryExecutionDataExtractionException(ex=com.jayway.jsonpath.spi.mapper.MappingException: java.lang.IllegalArgumentException: Cannot construct instance of `java.time.OffsetDateTime` (no Creators, like default constructor, exist): no String-argument constructor/factory method to deserialize from String value ('2021-04-15T11:37:22.424887-04:00')

line break issue

Request failed when some value has the line break like \n in it.

It's a bug, or my code missing necessary escape porcess?

I tried escape the \n to \\n in json value. But ther sever side treated the \\n to \n as string instead of line breaker. It's server side's fault?

client.reactiveExecuteQuery(queryRequest.serialize())
client is a instance of [WebClientGraphQLClient]

com.netflix.graphql.dgs.client.GraphQLClientException: 400 BAD_REQUEST "GraphQL server org.springframework.web.reactive.function.client.DefaultWebClient@59d42d75 responded with status code 400: '{"errors":[{"message":"Syntax Error: Unterminated string.","locations":[{"line":1,"column":107}],"extensions":{"code":"GRAPHQL_PARSE_FAILED"}}]} '. The request sent to the server was {"query":"mutation {createProduct(input: {categoryId:\"puaRCidQs8nVVNcXWbpgoZ\", condition:BRAND_NEW, description:\"サイズ\nS ( 身幅:60cm 着丈:119cm 肩幅:45cm 袖丈:66cm) M ( 身幅:62cm 着丈:120cm 肩幅:46cm 袖丈:67cm) L ( 身幅:64cm 着丈:121cm 肩幅:47cm 袖丈:68cm) XL ( 身幅:66cm 着丈:122cm 肩幅:48cm 袖丈:69cm) XXL ( 身幅:68cm 着丈:123cm 肩幅:49cm 袖丈:70cm)\n素材\n表地:ポリエステル100% 裏地:ポリエステル100% 中わた:ポリエステル100% その他:ポリエステル87%、ポリウレタン13%\n生産国\nベトナム\n\", imageUrls:[\"https://stc.milleporte.com/EVENTS/221105UNDE/web/960/4580637165083_1.jpg\", \"https://stc.milleporte.com/EVENTS/221105UNDE/web/960/4580637165083_2.jpg\"], name:\"UA LONG COAT WORD LOGO ブラック\", price:10460, shippingDuration:FOUR_TO_SEVEN_DAYS, shippingFromStateId:\"jp11\", shippingMethod:UNDECIDED, shippingPayer:SELLER, status:OPENED, variants:[{janCode:\"\", name:\"XL\", skuCode:\"16830662\", stockQuantity:1 }] }){ product { id variants { skuCode id } } } }","variables":{},"operationName":null}"

serializedRequest by ObjectMapper

WebClientGraphQLClient.class
@Suppress("BlockingMethodInNonBlockingContext") val serializedRequest = GraphQLClients.objectMapper.writeValueAsString( Request( query, variables, operationName ) )

I noticed some strange behavior I think in the the code above.

if the LF (\n) in json value, the result of serializedRequest is \n.
if the escaped LF (\n) in json value, the result of serializedRequest is \\n.

I expect result of serializedRequest is \n. (Since the server side can't parse the json which \n in it well, \n is OK.)
How can I do this? Can I customize the ObjectMapper above?

serialize for block string

Sorry if I'm wrong.
I noticed the method below it's seems like can not properly treat the block string (ex: description : """abc""" with triple ")
String com.netflix.graphql.dgs.client.codegen.GraphQLQueryRequest.serialize()

The value of string like ""abc"" will be treated as "\"\"abc\"\"" after serialize().

Any solution I can treat the block string properly with the DGS framework?

graphql/graphql-spec#327

Start failed

2022-02-25 16:26:45.961 WARN 9220 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dgsQueryExecutor' defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'dgsQueryExecutor' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schema' defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'schema' threw exception; nested exception is SchemaProblem{errors=[InvalidSyntaxError{ message=Invalid Syntax : offending token '' at line 1 column 1 ,offendingToken= ,locations=[SourceLocation{line=1, column=1}] ,sourcePreview=}]}

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-02-25 16:26:46.345 ERROR 9220 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

There are problems with the GraphQL Schema:
* InvalidSyntaxError{ message=Invalid Syntax : offending token '' at line 1 column 1 ,offendingToken= ,locations=[SourceLocation{line=1, column=1}] ,sourcePreview=}

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.