How to save URL parameters

In the previous post, we have seen how to save Email details.

Now, we will save URL parameters.

In some of the applications, we need to save URL or Links to read later. Hypi’s core app facilitates saving these details.

URL data type has fields to store URL parameters like URL name, query parameters, port, host, etc.

Let’s save URL parameters.

mutation {
  upsert(
    values: {
      URL: [
        {
          path: "https://api.hypi.app/rest/v1/fn/query/login"
          queryParams: "username=x&password=y&type=query"
          host: "https://api.hypi.app"
          port: 8080
        }
      ]
    }
  ) {
    id
  }
}

# result

{
  "data": {
    "upsert": [
      {
        "id": "01gehs596eyb6sp0033tmhhxyh"
      }
    ]
  }
}

get URL parameters using hypi.id

{
  get(type: URL, id: "01gehs596eyb6sp0033tmhhxyh") {
    ... on URL {
      hypi {
        id
        created
        updated
      }
      path
      port
      host
      queryParams
    }
  }
}
#result
{
  "data": {
    "get": {
      "hypi": {
        "id": "01gehs596eyb6sp0033tmhhxyh",
        "created": "2022-10-04T15:17:20Z",
        "updated": "2022-10-04T15:17:20Z"
      },
      "path": "https://api.hypi.app/rest/v1/fn/query/login",
      "port": 8080,
      "host": "https://api.hypi.app",
      "queryParams": "username=x&password=y&type=query"
    }
  }
}