• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Bagisto headless apis integration with flutterflow

General Discussion
2
2
163
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    msancheti last edited by msancheti 25 Jul 2024, 09:04 25 Jul 2024, 08:46

    How can i use bagisto headless apis for my flutterflow frontend.

    1 Reply Last reply Reply Quote 0
    • Rishabh-Webkul
      Rishabh-Webkul last edited by Rishabh-Webkul 25 Jul 2024, 10:57 25 Jul 2024, 10:56

      Hello @msancheti

      • Open your FlutterFlow project.

      • Go to the Settings & Integrations section.

      • Click on API Configuration.

      1. Add a New API:

        • Click on + Add API.

        • Choose GraphQL as the API type.

      2. Enter API Details:

        • Name: Give your API a meaningful name.

        • Endpoint URL: Enter the GraphQL API endpoint URL.

        • Headers: Add any required headers (e.g., authentication tokens, content type). If your API requires authentication, add the appropriate Authorization header.

        Example:

        plaintext

        Content-Type: application/json

        Authorization: Bearer YOUR_ACCESS_TOKEN

      3. Save the Configuration.

      Once your GraphQL API is set up, you need to define the queries and mutations you will use in your app.

      1. Add a Query/Mutation:

        • Go to the GraphQL API section in your FlutterFlow project.

        • Click on + Add GraphQL Query/Mutation.

      2. Define the Query/Mutation:

        • Name: Give your query/mutation a descriptive name.

        • Type: Choose whether it’s a query or a mutation.

        • GraphQL Body: Enter the GraphQL query/mutation. Make sure to include any required variables and fields.

        Example Query:

        graphql

        query GetUser($id: ID!) {

        user(id: $id) {

        id
        
        name
        
        email
        

        }

        }

        Example Mutation:

        graphql

        mutation AddUser($name: String!, $email: String!) {

        addUser(name: $name, email: $email) {

        id
        
        name
        
        email
        

        }

        }

      3. Specify Variables (if needed):

        • Define any variables your query or mutation requires. You can map these variables to data from your FlutterFlow widgets.
      4. Test the Query/Mutation:

        • Use the Test functionality in FlutterFlow to ensure your GraphQL queries/mutations return the expected data.
      5. Connect API Calls to Your UI

      Now that your GraphQL queries and mutations are defined, you can connect them to your FlutterFlow UI.

      1 Reply Last reply Reply Quote 0
      1 out of 2
      • First post
        1/2
        Last post