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

extendField should extend field extensions #177

Closed
stefanprobst opened this issue Mar 28, 2019 · 4 comments
Closed

extendField should extend field extensions #177

stefanprobst opened this issue Mar 28, 2019 · 4 comments
Labels

Comments

@stefanprobst
Copy link
Collaborator

Currently, extendField overwrites an existing extensions field property. I think it would be better if both extensions are merged?

const { ObjectTypeComposer, SchemaComposer } = require('graphql-compose');

const sc = new SchemaComposer();

const tc = ObjectTypeComposer.create(
  {
    name: 'Test',
    fields: {
      test: {
        type: 'String',
        extensions: { test: true },
      },
    },
  },
  sc
);

tc.extendField('test', {
  resolve: source => source.test,
  extensions: { added: true },
});

console.log(tc.getFieldExtensions('test'));
// { added: true }
// Should be { test: true, added: true }
@nodkz
Copy link
Member

nodkz commented Mar 28, 2019

Agreed with you. 👍
Can you sync with @freiksenet with this change?

And he also agreed can you make Pull Request?

@nodkz
Copy link
Member

nodkz commented Mar 28, 2019

I think that he is sleeping right now. So you may make Pull Request and we await his approving.

@freiksenet
Copy link
Collaborator

Yeah, I agree this is a better behavior. This is just an oversight on my part.

nodkz pushed a commit that referenced this issue Mar 28, 2019
* Extend field extensions in extendField
* fix: flowtype errors

closes #177
@nodkz
Copy link
Member

nodkz commented Mar 28, 2019

🎉 This issue has been resolved in version 6.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nodkz nodkz added the released label Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants