Skip to content

Allowed circular dependencies#72

Closed
pie6k wants to merge 1 commit intoindigotech:masterfrom
pie6k:feature/circular-references
Closed

Allowed circular dependencies#72
pie6k wants to merge 1 commit intoindigotech:masterfrom
pie6k:feature/circular-references

Conversation

@pie6k
Copy link
Copy Markdown

@pie6k pie6k commented Feb 6, 2018

Introducing circular dependencies.

@ObjectType()
class A {
  @Field({type: () => B}) b: any; // note that thunk - `() => B` is now required in case of circular references istead of just `{type: B}`
}

@ObjectType()
class B {
  @Field({type: () => A}) a: any; 
}

Read more: graphql/graphql-js#373

Here is original approach I've got idea from: VojtaStanek@6ace1fb

…o added tests and fixed tests that would break because of useage of thunk functions as fields getters
@tibawatanabe
Copy link
Copy Markdown

Closing this PR in favour of #68 (which resolves the same problem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants