Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access value resolved in one field in another field inside a objectType #1114

Open
rosnk opened this issue Jul 4, 2022 · 0 comments
Open

Comments

@rosnk
Copy link

rosnk commented Jul 4, 2022

export const Products = objectType({
  name: 'Products',
  definition(t) {
    t.id('id');
    t.int('total', {
      async resolve(parent, _args, ctx) {
      return 100;
    }});
    t.string('layout', {
      async resolve(parent, _args, ctx, info) {
          //  need to access total value here, 
	//  i assume total gets resolved first and total value //should be available via parent but its not.
      },
    });

	}
})

i need to access one resolved field value, in another field of a objectType.
In the above example, i need to access total inside, layout field, my assumption is total gets resolved first and is available via parent, but it is not.

Is there any way i can access total in layout?

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

No branches or pull requests

1 participant