Giter Site home page Giter Site logo

Support @nestjs/graphql@11 about nestjs-query HOT 2 CLOSED

tripss avatar tripss commented on May 28, 2024 4
Support @nestjs/graphql@11

from nestjs-query.

Comments (2)

TriPSs avatar TriPSs commented on May 28, 2024 2

@GP4cK would appreciate that! Thanks for the help!

from nestjs-query.

GP4cK avatar GP4cK commented on May 28, 2024

@TriPSs in nest/graphql, between 10.1.6 and 10.1.7, a change was introduced which make the graphql tests not independent.

I asked for some help from the nestjs team but so far, we haven't managed to come up with a solution.

Actually, even today, the tests are not super clean. For example, if you look at the snapshot for the test one read relation:

it('should use the object type name', () => expectResolverSDL({ one: { relation: { DTO: TestRelationDTO } } }))

The snapshot is:

exports[`ReadRelationsResolver one should use the object type name 1`] = `
type TestResolverDTO {
id: ID!
stringField: String!
relation: TestRelationDTO!
}
type TestRelationDTO {
id: ID!
testResolverId: String!
}
type TestRelationDTOEdge {
"""The node containing the TestRelationDTO"""
node: TestRelationDTO!
"""Cursor for this node."""
cursor: ConnectionCursor!
}
"""Cursor for paging through collections"""
scalar ConnectionCursor
type PageInfo {
"""true if paging forward and there are more records."""
hasNextPage: Boolean
"""true if paging backwards and there are more records."""
hasPreviousPage: Boolean
"""The cursor of the first returned record."""
startCursor: ConnectionCursor
"""The cursor of the last returned record."""
endCursor: ConnectionCursor
}
type OffsetPageInfo {
"""true if paging forward and there are more records."""
hasNextPage: Boolean
"""true if paging backwards and there are more records."""
hasPreviousPage: Boolean
}
type Query {
test: TestResolverDTO!
}
`;

Which still includes TestRelationDTOEdge, ConnectionCursor although there are not used in the schema.

I think that if we wrap the class definitions in a function, then it will fix this issue. How about I make a first PR without touching the dependencies, just to refactor the tests and the snippets, and then another one to upgrade nestjs/graphql? Do you agree with this approach?

from nestjs-query.

Related Issues (20)

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.