Get Specific fields (REST API)

Hello there,

I'm testing Prismic and my company will start using too.
But there we decided to use the REST API.

So is there any way to filter the results? Excluding some fields for example.

:v:

Hello Hideki,

Welcome to the community :slight_smile:

If you are looking to filter results in Prismic then you would need to use 'Predicates', in your case it sounds like you might need the not operator:

Does this answer your question?

Thanks.

Hey Phil, thank you :wave:

But I'm looking to filter the fields of a document. Like in GraphQL.
For example, I want to get all "users" document.type, but retrieve only the "name" and "address" fields from each user.

Thank you in advance

Ah OK, I understand now :blush:

In that case you can use the GraphQuery query option:

1 Like

Yeah, thank you again Phil!

Makes sense, we don’t need to stick to just the REST API, we can use both :see_no_evil:

In fact Graphquery isn't GraphQL, it's just a GraphQL like syntax inside our REST API

1 Like

Wow, that's cool, didn't know!

I'll study more about Prismic :+1:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.