community-content icon indicating copy to clipboard operation
community-content copied to clipboard

How to set up Strapi with Postgres and GraphQL

Open Alex-is-Gonzalez opened this issue 2 years ago • 8 comments

Hello, I want to write a tutorial to help others set up Strapi V4 with Postgres and GraphQL!

Here is an example:

What is Strapi, GraphQL, and Postgres? Installing Strapi : Installing Postgress: Configure Strapi to use Postgres: Installing graphQl from Strapi Marketplace: Testing graphQL connection: Conclusion

My content is

  • [X ] A Strapi Tutorial / Guide / How to article
  • [ ] About Headless, CMS, javascript, open source, or jamstack
  • [ ] Other, specify

Alex-is-Gonzalez avatar Sep 02 '22 22:09 Alex-is-Gonzalez

@PaulBratslavsky- How can I be assigned my topic?

Alex-is-Gonzalez avatar Sep 06 '22 19:09 Alex-is-Gonzalez

I think this is something that is already explained in our documentation. But if you like, you can write about how to create custom graphql resolvers and types to extend graphql functionality.

PaulBratslavsky avatar Sep 07 '22 22:09 PaulBratslavsky

Yes I can do that! However, I believe you already wrote an amazing article on this topic using Nextjs Blog. In order to make it different I would want to use React instead.

New Outline:

What is Strapi, GraphQL, and React? Installing Strapi : Installing React: Installing GraphQL from Strapi Marketplace: What are GraphQl Resolvers and types? Creating Custom GraphQl Resolvers Setting up React to interact with GraphQL resolvers Conclusion

Alex-is-Gonzalez avatar Sep 12 '22 19:09 Alex-is-Gonzalez

You can create something based on what I started with, possibly create a custom resolver that calls a custom service that pulls data from an API like GitHub and returns that data. Or saves it to Strapi. I can also answer any questions that you may have. In terms of GraphQl articles, we want to focus more on backend customization rather than frontend implementation.

PaulBratslavsky avatar Sep 21 '22 17:09 PaulBratslavsky

Hi @PaulBratslavsky, I can work on this article following the outline you've provide.

Thanks

icode247 avatar Sep 24 '22 15:09 icode247

Hi @Alex-is-Gonzalez , I can work on this topic

icode247 avatar Oct 05 '22 00:10 icode247

Hello @Alex-is-Gonzalez 👋 Have you thought about what Paul suggested? Let's wait for Alex's answer, otherwise, you can propose an outline taking into consideration Paul's suggestion @icode247

dessireugarte avatar Oct 11 '22 09:10 dessireugarte

Hello, Yes I can write an article for a custom graphQL resolver, @PaulBratslavsky , thank you for the direction. Here is a newly proposed outline for this article.

In this article, you will learn:

How to install and set up the Strapi GraphQL plugin Concepts like resolvers, mutations, and queries in the context of GraphQL How to customize Strapi's GraphQL backend with custom resolvers for queries and mutations

New Outline:

What is a headless CMS and graphQL? Installing Strapi : Installing GraphQL from Strapi Marketplace: What are GraphQl Resolvers and types? Creating Custom GraphQl Resolvers Setting up API to interact with GraphQL resolvers and Strapi Testing API data return to Strapi Conclusion

Alex-is-Gonzalez avatar Oct 11 '22 18:10 Alex-is-Gonzalez

@Alex-is-Gonzalez sorry for a late response, we have a lot of item in the cue for this year. At the moment we are not taking any new articles until January.

If you are still interested in this topic let me know. I am putting this on hold and will revisit in January.

PaulBratslavsky avatar Nov 17 '22 01:11 PaulBratslavsky

@malgamves How about this one?

Ashimi0x avatar Jan 11 '23 15:01 Ashimi0x

Hi @malgamves

Ashimi0x avatar Jan 11 '23 16:01 Ashimi0x

hey @Ashimi0x, I'll let @PaulBratslavsky get back to you on this one.

malgamves avatar Jan 18 '23 14:01 malgamves

@Ashimi0x since @Alex-is-Gonzalez requested this article let's check if he is willing to write it, with that in. mind, we are looking for intermediate use cases and customizations and error handling of using graphql.

PaulBratslavsky avatar Jan 20 '23 23:01 PaulBratslavsky

@Ashimi0x you can go ahead and author this Article, If the Strapi community approves it!

Alex-is-Gonzalez avatar Feb 07 '23 23:02 Alex-is-Gonzalez

Thanks @Alex-is-Gonzalez!

@Ashimi0x consider that there is already an existing tutorial on how to setup PostgreSQL and Strapi. We want to dive into more advanced topics beyond setting up Postgres and GraphQL.

I think that should be the beginning of the tutorial, but as Paul mentioned, customization and error handling using GraphQl would be a topic we are more interested in. Could you provide a more elaborated outline that covers that?

dessireugarte avatar Feb 17 '23 13:02 dessireugarte

Hi @dessireugarte

Here is a more indepth outline that covers all you mentioned.

Introduction to GraphQL and Strapi How GraphQL works Installing Strapi Installing GraphQL from Strapi Marketplace: Customing Strapi APIs with GraphQL Creating custom queries and mutations using GraphQL Errors that occur using GraphQL in Strapi Error handling in GraphQL Guidelines for error messages GraphQL Best Practices Performance optimization Security considerations Conclusion

Let me know what you think.

Ashimi0x avatar Feb 17 '23 15:02 Ashimi0x

Thanks @Ashimi0x, please go ahead and start the article. Could you please include in the article any resources that you consider valuable for readers? They can be included throughout the article or at the end like in this article.

dessireugarte avatar Feb 20 '23 15:02 dessireugarte

Alright. I will get started and will sure do as requested. Thank you. @dessireugarte

Ashimi0x avatar Feb 20 '23 17:02 Ashimi0x

Hello @Ashimi0x ! Are you still working on this topic?

dessireugarte avatar Apr 24 '23 18:04 dessireugarte

Hello @dessireugarte Yes, I am. I will send my draft link today.

Ashimi0x avatar Apr 24 '23 18:04 Ashimi0x

Hi @dessireugarte

Attached is the link to my draft https://www.dropbox.com/scl/fi/vnu7ysdhw9ldshzdqahug/Untitled-1.paper?dl=0&rlkey=hqk9qg5qbs4v93l2ijdg17cwy

Ashimi0x avatar Apr 24 '23 22:04 Ashimi0x

Thank you @Ashimi0x! We will review the draft

dessireugarte avatar Apr 25 '23 16:04 dessireugarte

Alright @dessireugarte

Ashimi0x avatar May 01 '23 21:05 Ashimi0x

Hi @dessireugarte any update?

Ashimi0x avatar May 09 '23 15:05 Ashimi0x

@Ashimi0x I started the review process will let you know if we need any changes.

PaulBratslavsky avatar May 15 '23 15:05 PaulBratslavsky

@Ashimi0x I added a note on your draft.

You can define GraphQL schema and resolvers to create custom queries and mutations in Strapi. The schema defines the structure of your APIs as well as the types of data you can query and the mutations you can perform.

Can you add an example of how to add this custom resolver in Strapi. Thank you.

PaulBratslavsky avatar May 15 '23 15:05 PaulBratslavsky

I have updated that. @PaulBratslavsky

Ashimi0x avatar May 15 '23 17:05 Ashimi0x

Hi @PaulBratslavsky

Ashimi0x avatar May 18 '23 16:05 Ashimi0x

@Ashimi0x thank you I will take a look at it, can you also share the git hub repo for the project.

PaulBratslavsky avatar May 18 '23 19:05 PaulBratslavsky

Hi @PaulBratslavsky https://github.com/Ashimi0x/strapibuild

Ashimi0x avatar May 31 '23 09:05 Ashimi0x