Squidex Client Library GetAsync References

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.

Not with the REST endpoint, but with GraphQL

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

Not yet, I will provide one.

Thanks a lot, @Sebastian !

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.

Thanks @Sebastian, appreciate it.

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.

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.

1 Like

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
        };

Never tried used it to be honest.

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