anymal-protocol 1.0.103 → 1.0.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -149,8 +149,8 @@ function useFetchUserData() {
149
149
  async (dbAuthToken, endpoint, walletAddress) => {
150
150
  try {
151
151
  const query = `
152
- query User {
153
- User(filter: { baseWalletAddress: { _eq: ${walletAddress} } }) {
152
+ query User($filter: UserFilterArg) {
153
+ User(filter: $filter) {
154
154
  _docID
155
155
  pid
156
156
  email
@@ -162,13 +162,18 @@ function useFetchUserData() {
162
162
  }
163
163
  }
164
164
  `;
165
+ const variables = {
166
+ filter: {
167
+ baseWalletAddress: { _eq: walletAddress }
168
+ }
169
+ };
165
170
  const response = await fetch(endpoint, {
166
171
  method: "POST",
167
172
  headers: {
168
173
  "Content-Type": "application/json",
169
174
  Authorization: `Bearer ${dbAuthToken}`
170
175
  },
171
- body: JSON.stringify({ query })
176
+ body: JSON.stringify({ query, variables })
172
177
  });
173
178
  if (!response.ok) {
174
179
  throw new Error(`HTTP error! Status: ${response.status}`);
package/dist/index.mjs CHANGED
@@ -86,8 +86,8 @@ function useFetchUserData() {
86
86
  async (dbAuthToken, endpoint, walletAddress) => {
87
87
  try {
88
88
  const query = `
89
- query User {
90
- User(filter: { baseWalletAddress: { _eq: ${walletAddress} } }) {
89
+ query User($filter: UserFilterArg) {
90
+ User(filter: $filter) {
91
91
  _docID
92
92
  pid
93
93
  email
@@ -99,13 +99,18 @@ function useFetchUserData() {
99
99
  }
100
100
  }
101
101
  `;
102
+ const variables = {
103
+ filter: {
104
+ baseWalletAddress: { _eq: walletAddress }
105
+ }
106
+ };
102
107
  const response = await fetch(endpoint, {
103
108
  method: "POST",
104
109
  headers: {
105
110
  "Content-Type": "application/json",
106
111
  Authorization: `Bearer ${dbAuthToken}`
107
112
  },
108
- body: JSON.stringify({ query })
113
+ body: JSON.stringify({ query, variables })
109
114
  });
110
115
  if (!response.ok) {
111
116
  throw new Error(`HTTP error! Status: ${response.status}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anymal-protocol",
3
- "version": "1.0.103",
3
+ "version": "1.0.104",
4
4
  "description": "A React/TypeScript-based utility library for reusable functions and hooks inside of the Anymal Ecosystem.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {