Git Product home page Git Product logo

Comments (19)

a0v0 avatar a0v0 commented on May 21, 2024

Here is the swagger definiton

{
  "swagger": "2.0",

  "host": "localhost:8080",
  "paths": {
    "/account/getme": {
      "get": {
        "description": "Get the account profile of currently logged in user.",
        "produces": ["application/json"],
        "tags": ["Account"],
        "summary": "Get Self Account",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/types_GetSelfAccountResponse"
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "types_GetSelfAccountResponse": {
      "type": "object",
      "properties": {
        "aid": {
          "description": "Account ID",
          "type": "string"
        },
        "created_at": {
          "description": "unix time of when the account was created",
          "type": "integer"
        },
        "profile": {
          "$ref": "#/definitions/types_UserProfile"
        },
        "uid": {
          "description": "User ID from supertokens",
          "type": "string"
        },
        "updated_time": {
          "description": "unix time of when the profile was last updated",
          "type": "integer"
        }
      }
    },

    "types_UserProfile": {
      "type": "object",
      "properties": {
        "bio": {
          "description": "bio of this account.",
          "type": "string"
        },
        "display_name": {
          "description": "the display name associated with this account.",
          "type": "string"
        },
        "gender": {
          "description": "Gender of the user. One of m(male), f(female), o(other), n(not specified)",
          "type": "string"
        },
        "location": {
          "description": "The location set by the user.",
          "type": "string"
        },
        "memorial": {
          "description": "is this account a memorial account? Has the owner of this account passed away?",
          "type": "boolean"
        },
        "pid": {
          "description": "Profile ID",
          "type": "string"
        },
        "username": {
          "description": "Username associated with this account.",
          "type": "string"
        }
      }
    }
  }
}

from wundergraph.

StarpTech avatar StarpTech commented on May 21, 2024

Hi @a0v0, you are using a very old version of wundergraph. Could you upgrade to the latest version and try again?

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024
   "@wundergraph/nextjs": "^0.3.15",
    "@wundergraph/sdk": "^0.116.1",
    "@wundergraph/swr": "^0.2.2",

from wundergraph.

StarpTech avatar StarpTech commented on May 21, 2024

Please be a bit more verbose πŸ˜„ So you can still reproduce it?

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

Yes, still the same problem.

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

I

   "@wundergraph/nextjs": "^0.3.15",
    "@wundergraph/sdk": "^0.116.1",
    "@wundergraph/swr": "^0.2.2",

@StarpTech is the version correct?

from wundergraph.

StarpTech avatar StarpTech commented on May 21, 2024

Yes, looks good. We'll investigate.

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

any luck on this one?

from wundergraph.

jensneuse avatar jensneuse commented on May 21, 2024

any luck on this one?

Hey, I'm sorry that it takes a while. My backlog is almost emptied. I'll look into this asap.

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

Still waiting...

from wundergraph.

fiam avatar fiam commented on May 21, 2024

@a0v0 It looks like something is wrong in your configuration. The swagger.json file is missing an info node and does not match the fields in SelfProfile.graphql. Are you sure you're posting the correct one? Thanks!

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

@a0v0 It looks like something is wrong in your configuration. The swagger.json file is missing an info node and does not match the fields in SelfProfile.graphql. Are you sure you're posting the correct one? Thanks!

This is the full swagger,json

{
    "swagger": "2.0",
    "info": {
      "description": "desc",
      "title": "api",
    
      "version": "1.0"
    },
    "host": "localhost:8080",
    "paths": {
      "/account/getme": {
        "get": {
          "description": "Get the account profile",
          "produces": ["application/json"],
          "tags": ["Account"],
          "summary": "Get Self Account",
          "responses": {
            "200": {
              "description": "OK",
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/account_GetSelfAccountSwaggerResponse"
                }
              }
            }
          }
        }
      },
      "/account/updateme": {
        "post": {
          "description": "Update the account ",
          "consumes": ["application/json"],
          "produces": ["application/json"],
          "tags": ["Account"],
          "summary": "Update Self Account",
          "parameters": [
            {
              "description": "body",
              "name": "body",
              "in": "body",
              "required": true,
              "schema": {
                "$ref": "#/definitions/types_UpdateSelfAccountRequest"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/xerr_ResponseSuccessBean"
                }
              }
            }
          }
        }
      },
      "/auth/session/refresh": {
        "post": {
          "description": "Refreshes",
          "tags": ["Auth/Passwordless"],
          "summary": "Refresh Session",
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/auth/signinup/code": {
        "post": {
          "description": "Send ",
          "consumes": ["application/json"],
          "produces": ["application/json"],
          "tags": ["Auth/Passwordless"],
          "summary": "Signup Code Request",
          "parameters": [
            {
              "description": "email",
              "name": "email",
              "in": "body",
              "required": true,
              "schema": {
                "$ref": "#/definitions/supertokens_SignupCodeRequest"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/supertokens_SignupCodeRequestResponse"
                }
              }
            }
          }
        }
      },
      "/auth/signinup/code/consume": {
        "post": {
          "description": "Consumes a signup code",
          "consumes": ["application/json"],
          "produces": ["application/json"],
          "tags": ["Auth/Passwordless"],
          "summary": "Signup Code Consume",
          "parameters": [
            {
              "description": "body",
              "name": "body",
              "in": "body",
              "required": true,
              "schema": {
                "$ref": "#/definitions/supertokens_SignupCodeConsume"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/supertokens_SignupCodeConsumeResponse"
                }
              }
            }
          }
        }
      },
      "/auth/signout": {
        "post": {
          "description": "Logout a.k.a revoke supertoken's passwordless session",
          "tags": ["Auth/Passwordless"],
          "summary": "Logout",
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      }
    },
    "definitions": {
      "account_GetSelfAccountSwaggerResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {
            "$ref": "#/definitions/types_GetSelfAccountResponse"
          },
          "msg": {
            "type": "string"
          }
        }
      },
      "supertokens_SignupCodeConsume": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "flowType": {
            "type": "string"
          },
          "preAuthSessionId": {
            "type": "string"
          },
          "userInputCode": {
            "type": "string"
          }
        }
      },
      "supertokens_SignupCodeConsumeResponse": {
        "type": "object",
        "properties": {
          "createdNewUser": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "user": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "phoneNumber": {
                "type": "string"
              },
              "timejoined": {
                "type": "integer"
              }
            }
          }
        }
      },
      "supertokens_SignupCodeRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "supertokens_SignupCodeRequestResponse": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "flowType": {
            "type": "string"
          },
          "preAuthSessionId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "types_GetSelfAccountResponse": {
        "type": "object",
        "properties": {
          "aid": {
            "description": "Account ID",
            "type": "string"
          },
          "created_at": {
            "description": "unix time of when the account was created",
            "type": "integer"
          },
          "profile": {
            "$ref": "#/definitions/types_UserProfile"
          },
          "uid": {
            "description": "User ID from supertokens",
            "type": "string"
          },
          "updated_time": {
            "description": "unix time of when the profile was last updated",
            "type": "integer"
          }
        }
      },
      "types_UpdateSelfAccountRequest": {
        "type": "object",
        "required": ["display_name", "gender"],
        "properties": {
          "bio": {
            "description": "bio of this account",
            "type": "string",
            "maxLength": 160
          },
          "display_name": {
            "description": "Display name of the account_",
            "type": "string",
            "maxLength": 50,
            "minLength": 2
          },
          "gender": {
            "description": "Gender of the user",
            "type": "string",
            "enum": ["male", "female", "other"]
          },
          "location": {
            "description": "Location of the account",
            "type": "string",
            "maxLength": 30
          },
          "memorial": {
            "description": "is this account a memorial account? Has the owner of this account passed away?",
            "type": "boolean"
          }
        }
      },
      "types_UserProfile": {
        "type": "object",
        "properties": {
          "bio": {
            "description": "bio of this account_",
            "type": "string"
          },
          "display_name": {
            "description": "the display name associated with this account_",
            "type": "string"
          },
          "gender": {
            "description": "Gender of the user. One of m(male), f(female), o(other), n(not specified)",
            "type": "string"
          },
          "location": {
            "description": "The location set by the user.",
            "type": "string"
          },
          "memorial": {
            "description": "is this account a memorial account? Has the owner of this account passed away?",
            "type": "boolean"
          },
          "pid": {
            "description": "Profile ID",
            "type": "string"
          },
          "username": {
            "description": "Username associated with this account_",
            "type": "string"
          }
        }
      },
      "xerr_ResponseSuccessBean": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {},
          "msg": {
            "type": "string"
          }
        }
      }
    }
  }

from wundergraph.

fiam avatar fiam commented on May 21, 2024

@a0v0 Thanks for the updated file. I'm looking into it.

from wundergraph.

fiam avatar fiam commented on May 21, 2024

@a0v0 I've reproduce the problem. I'll continue investigating.

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

@a0v0 I've reproduce the problem. I'll continue investigating.

ok waiting for a fix

from wundergraph.

fiam avatar fiam commented on May 21, 2024

@a0v0 Your swagger.json declares that your top level item is an array, but it's actually an object. If you wrap the data your server returns in an array, it works. e.g.

[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo","uid":"631dd6c5-e4c3-4975-8ca3-61f026430ec5","profile":{"pid":"JG2OTM9yLIfzECINpcttW","username":"","display_name":"rtweπŸš‰te","bio":"I am bio πŸš‰","gender":"other","location":"s","memorial":false},"created_at":1666201846162,"updated_time":1666202011}}]
$ curl 'http://localhost:9991/fapi/main/operations/SelfProfile'                                                           (10-28 14:12)
{"data":{"fapi_getAccountGetme":[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo"}}]}}% 

We'll add some checks to return an error in this case, but there's no actual bug.

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

"type": "array",

oh, this! I will try to fix and reply back

from wundergraph.

a0v0 avatar a0v0 commented on May 21, 2024

@a0v0 Your swagger.json declares that your top level item is an array, but it's actually an object. If you wrap the data your server returns in an array, it works. e.g.

[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo","uid":"631dd6c5-e4c3-4975-8ca3-61f026430ec5","profile":{"pid":"JG2OTM9yLIfzECINpcttW","username":"","display_name":"rtweπŸš‰te","bio":"I am bio πŸš‰","gender":"other","location":"s","memorial":false},"created_at":1666201846162,"updated_time":1666202011}}]
$ curl 'http://localhost:9991/fapi/main/operations/SelfProfile'                                                           (10-28 14:12)
{"data":{"fapi_getAccountGetme":[{"code":200,"msg":"OK","data":{"aid":"WQE8DKodOomqZ_HTNxaYo"}}]}}% 

We'll add some checks to return an error in this case, but there's no actual bug.

Thanks. Changing return type to object fixed the problem. Closing the issue.

from wundergraph.

fiam avatar fiam commented on May 21, 2024

Thanks. Changing return type to object fixed the problem. Closing the issue.

You're welcome. Thanks for letting us know!

from wundergraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.