Squidex Client Library GetAsync References


#1

Hi everybody,

We are running squidex in azure and our web application consumes the content from it.
As a data access layer we use Squidex.ClientLibrary 3.2.0 and everything works fine.
However, when I request an entity, which contains Reference Field or Asset Field it returns me guids.

Is there a way to tell the squidex client to include reference entity and/or resolve asset url?
We just trying to avoid extra calls.

Thanks,
Alexander.


#2

Not with the REST endpoint, but with GraphQL


#3

Is there an example of how I can consume data from squidex using GraphQL in my asp.net core application?


#4

Not yet, I will provide one.


#5

Thanks a lot, @Sebastian !


#6

I have added a sample to the tests: https://github.com/Squidex/squidex-samples/blob/master/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/ClientQueryTests.cs#L67

Version 3.7 is on the way.


#7

Thanks @Sebastian, appreciate it.


#8

Hey @Sebastian, one more question about querying squidex using graphql.

Let’s say I have a blog-post schema and blog-category schema. blog-post schema has a reference field to the blog-category content item. How do I query all the blog-post items where blog-category equals to some value?

Thanks,
Alexander.


#9

WIth this constellation you would need the ID of the blog category right now. EIther hardcoded or from another query.

Then you can use the filter, e.g.

queryBlogPostContents(filter: "data/category/iv eq 'my-id'") {
   id,
   ...
}

Perhaps a chance for further improvements.


#10

Just for your information: another issue i’ve been struggling with is passing a fragment in graphql query.
something like:

 var query = new
        {
            query = @"{
                        queryBlogContentsWithTotal(skip: " + page * pageSize + ", top: " + pageSize + @"){
                            total,
                            items{
                                 ..." + QueryFragmentName + @"
                            }
                        }
                    }",
            fragment = @" " + QueryFragmentName + " on " + QueryFragmentEntityName + " " + QueryFragment
        };

#11

Never tried used it to be honest.

Btw: You can make your life easier with string interpolation.