Skip to content

Commit c7635b9

Browse files
committed
chore: update CHANGELOG and README
1 parent 6a56915 commit c7635b9

File tree

2 files changed

+57
-16
lines changed

2 files changed

+57
-16
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [0.3.0] - 2018-04-03
8+
### Changed
9+
- Updated package versions in `devDependencies`
10+
- Updated `graphql` version dependency to `0.13.1`
11+
- Added [Prettier](https://prettier.io/) configuration to `package.json`
12+
- Linted (based on updates to eslint packages) and Prettier-ed all files
13+
14+
### Added
15+
- PhoneNumber
16+
- PostalCode
17+
- `package-lock.json`
18+
719
## [0.2.0] - 2018-01-16
820
### Changed
921
- Implemented more strict numeric type checking

README.md

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ scalar NegativeFloat
3030

3131
scalar EmailAddress
3232
scalar URL
33+
34+
scalar PhoneNumber
35+
scalar PostalCode
3336
```
3437

3538
In your resolver map, first import them:
@@ -49,6 +52,9 @@ import {
4952

5053
EmailAddress,
5154
URL,
55+
56+
PhoneNumber,
57+
PostalCode,
5258
} from '@okgrow/graphql-scalars';
5359
```
5460

@@ -71,6 +77,9 @@ const myResolverMap = {
7177
EmailAddress,
7278
URL,
7379

80+
PhoneNumber,
81+
PostalCode,
82+
7483
Query: {
7584
// more stuff here
7685
},
@@ -117,6 +126,9 @@ type Person {
117126

118127
email: EmailAddress
119128
homePage: URL
129+
130+
phoneNumber: PhoneNumber
131+
homePostalCode: PostalCode
120132
}
121133

122134
```
@@ -181,28 +193,45 @@ A field whose value conforms to the standard internet email address format as sp
181193
A field whose value conforms to the standard URL format as specified in
182194
[RFC3986](https://www.ietf.org/rfc/rfc3986.txt).
183195

196+
### PhoneNumber
197+
A field whose value conforms to the standard E.164 format as specified in
198+
[E.164 specification](https://en.wikipedia.org/wiki/E.164). Basically this is `+17895551234`.
199+
The very powerful
200+
[`libphonenumber` library](https://github.com/googlei18n/libphonenumber) is available to take
201+
_that_ format, parse and display it in whatever display format you want. It can also be used to
202+
parse user input and _get_ the E.164 format to pass _into_ a schema.
184203

185-
## Future
186-
We'd like to keep growing this package, within reason, to include the scalar types that are widely
187-
required when defining GraphQL schemas. We welcome both suggestions and pull requests. A couple of
188-
ideas we're considering are:
204+
### PostalCode
205+
We're going to start with a limited set as suggested [here] (http://www.pixelenvision.com/1708/zip-postal-code-validation-regex-php-code-for-12-countries/)
206+
and [here] (https://stackoverflow.com/questions/578406/what-is-the-ultimate-postal-code-and-zip-regex).
189207

190-
- PhoneNumber
191-
- PostalCode
192-
- BLOB
208+
Which gives us the following countries:
193209

194-
These all have challenges in terms of making them globally useful so they need a bit of thought.
210+
- US - United States
211+
- UK - United Kingdom
212+
- DE - Germany
213+
- CA - Canada
214+
- FR - France
215+
- IT - Italy
216+
- AU - Australia
217+
- NL - Netherlands
218+
- ES - Spain
219+
- DK - Denmark
220+
- SE - Sweden
221+
- BE - Belgium
222+
- IN - India
195223

196-
For `PhoneNumber` we can probably just use the [E.164 specification](https://en.wikipedia.org/wiki/E.164)
197-
which is simply `+17895551234`. The very powerful
198-
[`libphonenumber` library](https://github.com/googlei18n/libphonenumber) is available to take
199-
_that_ format, parse and display it in whatever display format you want. It can also be used to
200-
parse user input and _get_ the E.164 format to pass _into_ a schema.
224+
This is really a practical decision of weight (of the package) vs. completeness.
201225

202-
Postal codes are [a bit more involved](https://en.wikipedia.org/wiki/List_of_postal_codes). But,
203-
again, it's probably just a really long regex.
226+
In the future we might expand this list and use the more comprehensive list found [here] (http://unicode.org/cldr/trac/browser/tags/release-26-0-1/common/supplemental/postalCodeData.xml).
227+
228+
229+
## Future
230+
We'd like to keep growing this package, within reason, to include the scalar types that are widely
231+
required when defining GraphQL schemas. We welcome both suggestions and pull requests. One idea
232+
we're considering is:
204233

205-
BLOBs could be a base64-encoded object of some kind.
234+
- BLOB, could be could be a base64-encoded object of some kind
206235

207236
## What's this all about?
208237
GraphQL is a wonderful new approach to application data and API layers that's gaining momentum. If

0 commit comments

Comments
 (0)