API URL of Next.XP 2.0

Enonic version: 7.13.2

I am about updating NEXT.XP from version1 to version2 .
I noticed that the Environment variable changed a bit. It seems that this breaks my implementation as I use GraphQL embedded and provide my API as service on the following endpoints:

# Absolute URL to Content API
CONTENT_API_DRAFT=http://localhost:8080/site/default/draft/osde/_graphql
CONTENT_API_MASTER=http://localhost:8080/site/default/master/osde/_graphql

The provided sample application uses the Guillotine App with an endpoint which would look in my case like http://localhost:8080/site/osde/master

The config in .env looks now

# Enonic app name, used for convenience in queries and mappings
ENONIC_APP_NAME=de.osde.app.be

# Absolute URL to Content API
ENONIC_API=http://127.0.0.1:8080/site/
# ENONIC_API=http://localhost:8080/site/default/draft/osde/_graphql

# Enonic XP projects configuration for different locales
ENONIC_PROJECTS=osde/osde

How must I configure my Next.XP frontend to use an embedded GraphQL -endpoint?

Hi @luctho !

There is a short article about upgrading from v 1.x here in case you missed it.

Using app guillotine would be the easiest way, because it will create all the endpoints needed for your next.xp. More about that in the tutorial

In your case that will be the following urls:

http://localhost:8080/site/osde/draft
http://localhost:8080/site/osde/master

In case you can not use app-guillotine, you will have to move your graphql APIs to those urls manually in order for Next.xp 2 to work correctly.

Also, remember that if you don’t use app-guillotine and add more locales:

ENONIC_PROJECTS=osde/osde,en:osde-en/osde

you will have to add graphql API for every locale too:

http://localhost:8080/site/osde-en/draft
http://localhost:8080/site/osde-en/master

Hope this helps !

@pmi Thx for the hints.

There is currently only 1 reason for the embedded Version: Navigation!!
I extended GraphQL to serve the navigation using lib-menu

Is there annother solution for serving the navigation-structure ?

How can I achieve that ?
Does XP offer a solution for that- or do I have to redirect e.g. at the load-balancer ?

Hi Thomas.

Yes, the solution is right around the corner.
With Guillotine 7, you can extend / augment the API with other apps!

A new “menu” app will also be available, that does this out of the box.

@tsi Thanx!

Sounds good :slight_smile:

Sounds also good !!

What is the timeframe ???

We are in the testing phase…

1 Like