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

0.4.0 #8

Merged
13 commits merged into from
Apr 27, 2018
Merged

0.4.0 #8

13 commits merged into from
Apr 27, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 13, 2018

  • Added RegularExpression scalar generator
  • Added UnsignedInt and UnsignedFloat aliases
  • Added yarn.lock (with corresponding package updates)

@ghost ghost requested a review from cfnelson April 13, 2018 14:30
Copy link
Contributor

@cfnelson cfnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 🙌 I left a few comments that maybe I would recommend reviewing and accepting or dismissing before merging. Otherwise looks like a good release! :)

Before you do release, bump ur own pkg version in your lock file so it's in sync with the release commit.

NOTE: I haven't run the tests locally yet, but noticed a few fixme or todos about some tests not throwing or passing? I can check this PR out locally if there are still issues that you want me to inspect.

CHANGELOG.md Outdated
* `RegularExpression` scalar type _generator_
* `UnsignedInt` alias for `NonNegativeInt`
* `UnsignedFloat` alias for `NonNegativeFloat`
* `yarn.lock`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's a good idea to commit and mix both npm & yarn lock files. Have run into issues before were they can get out of sync and cause confusion.

As the package.json file is using npm I would recommend only committing the package-lock.json file for npm as that is what we are using for the build/test/publish scripts. Lock files don't get published, having them here is for someone developing or testing, and the build and tests are using npm.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

```

NOTE: `NonNegativeFloat` and `NonNegativeInt` are also available under the aliases `UnsignedFloat`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇 Nice thinking!

README.md Outdated
```

Given this, if we want to create a new type that is essentially the same except for one little
customizable aspect (e.g., a regular expression type that has ll the same code except the regex is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing an a from has ll the same ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.

README.md Outdated
parameters. That's the approach we take here.

Therefore the `RegularExpression` scalar type is really a `GraphQLScalarType` object _generator_
that takes two arguments: a name and the regex you want it to use. So to create a new scalar for a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting suggestion, use bullet points e.g ->

... that takes two arguments:

  • a name,
  • the regex you want it to use

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* `regex` - The regex to be used to check against any values for fields with this new type

```
const MyRegexType = new RegexType('MyRegexType', /^ABC$/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend thinking about using an object with named params for the function signature instead of 2 params. It provides a simple escape hatch for future modifications to your function signature whilst enabling a simple approach to backwards compatibility.
e.g ->const MyRegexType = new RegexType({ name: 'MyRegexType', regex: /^ABC$/ });

Then again I will admit I am biased 😂

);
});

// FIXME: Does nothing. No throw. Call doesn't even seem to get to the parseValue() function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still occurring?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up several. Some comments still remain because these are still issues.

@ghost ghost merged commit c2aae41 into master Apr 27, 2018
@ghost ghost deleted the 0.4.0 branch April 27, 2018 13:26
vespertilian pushed a commit to vespertilian/graphql-scalars that referenced this pull request Oct 2, 2020
This pull request was closed.
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