-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in React framwork when hydrating scalars (#1282)
- Loading branch information
1 parent
7f426d9
commit 250ff78
Showing
30 changed files
with
644 additions
and
613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'houdini-react': patch | ||
--- | ||
|
||
Fix bug marshaling/unmarshaling scalars over network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
type A { | ||
a: String! | ||
id: ID! | ||
} | ||
|
||
interface Animal implements Node { | ||
id: ID! | ||
name: String! | ||
} | ||
|
||
interface AnimalConnection { | ||
edges: [AnimalEdge!]! | ||
pageInfo: PageInfo! | ||
} | ||
|
||
interface AnimalEdge { | ||
cursor: String | ||
node: Animal | ||
} | ||
|
||
type B { | ||
b: String! | ||
id: ID! | ||
} | ||
|
||
type Book { | ||
id: ID! | ||
title: String! | ||
} | ||
|
||
type City { | ||
id: ID! | ||
libraries: [Library]! | ||
name: String! | ||
} | ||
|
||
"""Date custom scalar type""" | ||
scalar DateTime | ||
|
||
scalar File | ||
|
||
enum ForceReturn { | ||
ERROR | ||
NORMAL | ||
NULL | ||
} | ||
|
||
type Library { | ||
books: [Book]! | ||
id: ID! | ||
name: String! | ||
} | ||
|
||
type Message1 { | ||
message: String! | ||
} | ||
|
||
type Monkey implements Animal & Node { | ||
hasBanana: Boolean! | ||
id: ID! | ||
name: String! | ||
} | ||
|
||
type MonkeyConnection implements AnimalConnection { | ||
edges: [MonkeyEdge!]! | ||
pageInfo: PageInfo! | ||
} | ||
|
||
type MonkeyEdge implements AnimalEdge { | ||
cursor: String | ||
node: Monkey | ||
} | ||
|
||
type Mutation { | ||
addBook(library: ID!, title: String!): Book! | ||
addCity(name: String!): City! | ||
addLibrary(city: ID!, name: String!): Library! | ||
addNonNullUser(birthDate: DateTime!, delay: Int, enumValue: MyEnum, force: ForceReturn, name: String!, snapshot: String!, types: [TypeOfUser!]): User! | ||
addUser(birthDate: DateTime!, delay: Int, enumValue: MyEnum, force: ForceReturn, name: String!, snapshot: String!, types: [TypeOfUser!]): User | ||
createA(a: String!): A! | ||
createB(b: String!): B! | ||
deleteBook(book: ID!, delay: Int, force: ForceReturn): Book | ||
deleteCity(city: ID!): City! | ||
deleteLibrary(library: ID!): Library! | ||
multipleUpload(files: [File!]!): [String!]! | ||
singleUpload(file: File!): String! | ||
updateRentedBook(bookId: Int!, rate: Int!, userId: String!): RentedBook | ||
updateUser(birthDate: DateTime, delay: Int, id: ID!, name: String, snapshot: String!): User! | ||
} | ||
|
||
enum MyEnum { | ||
Value1 | ||
Value2 | ||
} | ||
|
||
interface Node { | ||
id: ID! | ||
} | ||
|
||
type PageInfo { | ||
endCursor: String | ||
hasNextPage: Boolean! | ||
hasPreviousPage: Boolean! | ||
startCursor: String | ||
} | ||
|
||
type Query { | ||
aOrB: [UnionAorB!]! | ||
animals: AnimalConnection! | ||
avgYearsBirthDate: Float! | ||
cities: [City]! | ||
city(delay: Int, id: ID!): City | ||
hello: String | ||
monkey(id: ID!): Monkey | ||
monkeys: MonkeyConnection! | ||
node(id: ID!): Node | ||
rentedBooks: [RentedBook!]! | ||
session: String | ||
user(delay: Int, forceNullDate: Boolean, id: ID!, snapshot: String!, tmp: Boolean): User! | ||
userNodes(limit: Int = 4, offset: Int, snapshot: String!): UserNodes! | ||
userNodesResult(forceMessage: Boolean!, snapshot: String!): UserNodesResult! | ||
userResult(forceMessage: Boolean!, id: ID!, snapshot: String!): UserResult! | ||
userSearch(filter: UserNameFilter!, snapshot: String!): [User!]! | ||
usersConnection(after: String, before: String, first: Int, last: Int, snapshot: String!): UserConnection! | ||
usersList(limit: Int = 4, offset: Int, snapshot: String!): [User!]! | ||
} | ||
|
||
type RentedBook { | ||
bookId: Int! | ||
rate: Int! | ||
userId: String! | ||
} | ||
|
||
type Subscription { | ||
userUpdate(id: ID!, snapshot: String): User | ||
} | ||
|
||
enum TypeOfUser { | ||
COOL | ||
NICE | ||
} | ||
|
||
union UnionAorB = A | B | ||
|
||
type User implements Node { | ||
avatarURL(size: Int): String! | ||
birthDate: DateTime | ||
enumValue: MyEnum | ||
friendsConnection(after: String, before: String, first: Int, last: Int): UserConnection! | ||
friendsList(limit: Int, offset: Int): [User!]! | ||
id: ID! | ||
name: String! | ||
testField(someParam: Boolean!): String | ||
types: [TypeOfUser!]! | ||
|
||
""" | ||
This is the same list as what's used globally. its here to tests fragments | ||
""" | ||
userSearch(filter: UserNameFilter!, snapshot: String!): [User!]! | ||
|
||
""" | ||
This is the same list as what's used globally. its here to tests fragments | ||
""" | ||
usersConnection(after: String, before: String, first: Int, last: Int): UserConnection! | ||
usersConnectionSnapshot(after: String, before: String, first: Int, last: Int, snapshot: String!): UserConnection! | ||
} | ||
|
||
type UserConnection { | ||
edges: [UserEdge!]! | ||
pageInfo: PageInfo! | ||
} | ||
|
||
type UserEdge { | ||
cursor: String | ||
node: User | ||
} | ||
|
||
input UserNameFilter { | ||
name: String! | ||
} | ||
|
||
type UserNodes { | ||
nodes: [User!]! | ||
totalCount: Int | ||
} | ||
|
||
union UserNodesResult = Message1 | UserNodes | ||
|
||
union UserResult = Message1 | User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { HoudiniClient } from '$houdini' | ||
|
||
// Export the Houdini client | ||
export default new HoudiniClient() | ||
export default new HoudiniClient({ | ||
url: 'http://localhost:4000/graphql', | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.