Skip to content

fixed issue with pointer to scalar values #199

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

Merged
merged 3 commits into from
May 13, 2017

Conversation

jhaynie
Copy link
Contributor

@jhaynie jhaynie commented Apr 30, 2017

If you have a response struct like the following:

struct Foo {
   Bar *string  `json:"bar"`
}

And Bar is nil. The result will be incorrectly encoded on returning. The result will be \u003cnil\u003e instead of null (when serialized to JSON).

This fix will fix isNullish to check for *string type and other primitive types.

@coveralls
Copy link

coveralls commented Apr 30, 2017

Coverage Status

Coverage decreased (-0.03%) to 82.573% when pulling 2dd87f4 on jhaynie:master into 44a52a8 on graphql-go:master.

@coveralls
Copy link

coveralls commented Apr 30, 2017

Coverage Status

Coverage decreased (-0.1%) to 82.478% when pulling 7b41a76 on jhaynie:master into 44a52a8 on graphql-go:master.

@jhaynie jhaynie changed the title fixed issue with pointer to string fixed issue with pointer to scalar values Apr 30, 2017
@coveralls
Copy link

coveralls commented Apr 30, 2017

Coverage Status

Coverage decreased (-0.6%) to 82.046% when pulling 1fc7c7c on jhaynie:master into 44a52a8 on graphql-go:master.

@chris-ramon
Copy link
Member

LGTM 👍 — thanks a lot @jhaynie

@chris-ramon chris-ramon merged commit fe52096 into graphql-go:master May 13, 2017
deoxxa pushed a commit to deoxxa/graphql-go that referenced this pull request Dec 11, 2017
This is a rebased and updated version of @tgriesser's graphql-go#199. I further extended it to completely remove the side-effectful mutation of Interface types rather than just deferring that mutation to schema creation time.

This introduces a *breaking* change to the Type System API. Now, any individual Interface type does not have the required information to answer `getPossibleTypes` or `isPossibleType` without knowing the other types in the Schema. These methods were moved to the Schema API, accepting the abstract type as the first parameter.

This also introduces a *breaking* change to the type comparator functions: `isTypeSubTypeOf` and `doTypesOverlap` which now require a Schema as a first argument.

Commit:
6a1f23e1f9c1e6bf4cea837bc9bb6eae0fb5c382 [6a1f23e]
Parents:
a781b556ee
Author:
Lee Byron <[email protected]>
Date:
23 March 2016 at 1:17:43 PM SGT
Commit Date:
25 March 2016 at 6:35:39 AM SGT
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.

3 participants